Skip to content

VS2013 atomic_flag compile error #3

@Ron2

Description

@Ron2

Hi, thanks for making this project. I've been doing C# for over seven years, so it's a good learning experience for me!

When trying to get this running in Visual Studio 2013, I got this compile error:

Error   1   error C2280: 'std::atomic_flag::atomic_flag(const std::atomic_flag &)' : attempting to reference a deleted function c:\sceadev\github\concurentqueue\concurrentqueue\concurrentqueue.h  438 1   LockFreeConcurrentQueue

The compile error is because this member initializer:

        implicitProducerHashResizeInProgress(ATOMIC_FLAG_INIT),

... uses a constructor that is deleted:

    atomic_flag(const atomic_flag&) = delete;

The default parameterless constructor is available, so the fix is to remove the ATOMIC_FLAG_INIT parameter and the atomic_flag still gets initialized to zero. Line 436 becomes:

        implicitProducerHashResizeInProgress(),

I have no idea what the repercussions are for other compilers. I also don't understand why you haven't encountered this problem. I'm compiling for Win32, in case that matters.

--Ron

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions