Boost variant which




















The type of the variant object is guaranteed to be one of the types supplied as parameters. For example, in:. Implementation uses no virtual calls and usually the objects are placed on the stack, ensuring high efficiency.

General utilities Date and time Function objects bitset. Run this code. Compiler support. Freestanding and hosted. Language support library. Technical specifications. Language support. Boost Variant: how to get currently held type?

Ask Question. Asked 9 years, 11 months ago. Active 1 year, 4 months ago. Viewed 60k times. Improve this question. Add a comment. Active Oldest Votes. Improve this answer. Ferruccio Ferruccio No, it has a fixed set of types. But it's pretty simple, although tedious, to add new types. Especially if you want to allow operations between types. Variant vs. Any Portability Troubleshooting Acknowledgments References. Abstract Motivation. Full value semantics, including adherence to standard overload resolution rules for conversion operations.

Run-time checked explicit value retrieval via boost::get. Problem Solution: A Motivating Example.



0コメント

  • 1000 / 1000