c++ - Boost Variant: Is there magic in the binding order? -


I am reading everything I can get (my headache). Some people were surprised that a string To save was saved as a hair. If I've listed the bool (after?) Before char * then a string will be saved as a char * string literally? What is the order between v1 and v2 ?

  boost :: variant & lt; Char *, bool & gt; V1 = "Hello"; Promotion: version & lt; Bool, char * & gt; V2 = "Hello";  

For integer, should I just tie the biggest integer for all integers or individually int8_t thru int64_t Should bind? If I have bound all of them, then fit into any of these, which has been saved as the first (last)?

How to float versus double ?

There is no magic.

Constructor's document behavior.

Template & lt; Typename T & gt;

Required : Any one of the rotating types (i.e., T1, T2, etc.) must be non-essentially convertible.

Postcondition : The content limit is one of the best conversions for operand for one of the limited dimensions, as determined by the standard surcharge resolution rules.

throws : With any exception arising from the conversion of operand, it may fail.

boost / variant.hpp> Int main () {{boost :: variant & lt; Bool, std :: string & gt; V; V = "Hello"; // Four Conte (& amp;) [6] converts to Bull (0 == v.which ()); V = static_cast & lt; Char const *> ("Hello"); Insert (0 == V. Joe ()); } // compare {boost :: variant & lt; Bool, char const *> V; V = "Hello"; // four consists (& amp;) [6] emphasize (1 == v.which ()); // Now match directly v = static_cast & lt; Char const *> ("Hello"); Emphasize (1 = V. he ()); }}

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -