Q:

use of deleted function - std::atomic

This is the declaration I have in .h file:
static std::atomic<int> OrdersExecutorIdCounter;

This is initilization from .cpp file:
std::atomic<int> ActionBasedOrdersExecutor::OrdersExecutorIdCounter = 0;

It compiles just fine in VC++, but in gcc 4.8 I get this error:
error: use of deleted function ‘std::atomic<int>::atomic(const std::atomic<int>&)’

How can I solve this problem? 

A:

You can directly initialise the atomic variable, which does not require deleted copy constructor, eg:
std::atomic<int> ActionBasedOrdersExecutor::OrdersExecutorIdCounter{0};

