In my code I save data in a binary file, when I save I run the function save() in a different thread. The data that I'm saving are stored in a vector&lt;uint_32&gt;, this vector is used also by others function and I did a  copy to avoid conflicts and not desired modification, I think that this isn't the most efficient way to solve this problem so I want ask which is the best way to have this kind of behavior? I was thinking about shared pointers, maybe. 
here is the code:

inline void write( std::vector&lt;uint32_t &gt; pData ) {
    fThread = std::thread( &amp;FileHandler::writeFile, this, pData );
    fThread.join();
}
inline void writeFile( std::vector&lt;uint32_t&gt;  cVectorCopy ) {
    fwrite( ( char* )&amp;cVectorCopy[0]  , cVectorCopy.size()*sizeof( uint32_t ) , 1, fBinaryFile );
    closeFile();
}



Question: Is there a name for the number of values a variable can take?
Answer: If you subscribe to the "types as a set of values" interpretation of type theory, then cardinality is in fact a good name.

So, the cardinality of bool would be 2, the cardinality of byte would be 256, and the cardinality of String would be &aleph;0.