c++ - boost atomic class make initialize values different from member initialization list -


I first: Promote atomic class and there is an initial problem.

I have an active data structure

  struct rowactive data {RoActivate Data}: _rowActive (0), _rowActiveFile (0), _rowActiveTrack (1) {} size_t _rowActive; Size_t _rowActiveFile; Size_t _rowActiveTrack; };  

and Row Active Structure use it

Stroke IOActive (Virtual Zero SatelliteActive (size_T line) = 0;}; Structure Row activated: Public IROactive {Row Active () {} Virtual Zero Retroactive (size_T line) {RoActivate Data TMP Data; TmpData._rowActive = Row; TmpData._rowActiveFile = Line * 2; TmpData._rowActiveTrack = Row * 3;} // boost :: atomic // & Lt; rochitvdata & gt; _free; roeviddata_data;};

my question The process is going on, I see that everything is fine, it tells me my values ​​

  _rowActiveFile 0 and _rowActiveTrack is 1.  

But when I make a comment,

  // rovitdata_data;  

and extract the atomic comment

  Promotion: : Atomic Roth Active Data   

This gives me the garbage value I

What could be wrong? According to the documentation, the empty constructor one unspecified Starts for value.

. Try

  Prompt: Atom & lt; Roquivettaia & gt; _data (RowActiveData ());  

is on the Boost Docs

In addition, I have checked, and I feel that at least one of the four array members instead of RoverActivities to promote Will be used, so do not call the constructor.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -