c++ - cannot able to create enum type as atomic -
#include <iostream> #include <atomic> using namespace std; typedef enum day{sun =0, mon, tue}day; int main() { atomic<day> a(sun); cout<<a<<endl; return 0; }
the above code try create enum variable atomic type. getting following error.
undefined reference std::atomic<day>::operator day() const
does atomic have no support enum type? or mistake in syntax? using g++ compiler running on 32 bit ubuntu 12.0.4 machine. thank you.
i've compiled same code online compiler supports c++11 & c++14. didn't issues.
atomic
isn't available before c++11 standards.
for reference: http://ideone.com/fork/pe4gvt
Comments
Post a Comment