template-meta-programming
is_same returning false when comparing class template instantiation with its base class template?
*Edit: Somehow I thought the compiler was creating B just as A<int, int, string>, leading to my assumption about how is_same should evaluate them, regardless of inheritance/derivation.My bad :(S[详细]
2023-03-06 01:16 分类:问答C++0x nested initializer lists
I would like to use C++0x new initializer list feature to initialize a std::vector with a compile time defined number of items for a new API I\'m currently working on. Something like this:[详细]
2023-03-02 09:37 分类:问答C++ compile time function execution
I have string tags in my code that are converted to numbers and used to search values in a tag-value structure.[详细]
2023-03-02 03:18 分类:问答Replacing this macro
Given this macro #define MAKE_TYPE(_a, _b, _c, _d) ((_a) | ((_b) << 8) | ((_c) << 16) | ((_d) << 24))[详细]
2023-02-23 06:15 分类:问答templated template parameter list with template types
C++ allows templated template parameters like this: template <template <bool> class T> struct something1 {};[详细]
2023-02-21 04:36 分类:问答Detecting basic_string instantiation
I wrote the following code to determine if a type is an instantiation of std::basic_string: template <ty开发者_JAVA技巧pename T>[详细]
2023-02-13 11:21 分类:问答boost spirit expectation failure
I want to parse a vector of the following struct: BOOST_FUSION_ADAPT_STRUCT( event_model::OTNDescriptor,[详细]
2023-02-11 05:34 分类:问答C++ Dynamic Dispatch without Virtual Functions
I\'ve got some legacy code that, instead of virtual functions, uses a kind field to do dynamic dispatch.It looks something like this:[详细]
2023-02-04 22:43 分类:问答How to know if the argument that is passed to the function is a class, union or enum in c++?
I want to define an operator<< for all enums, to cout the value and print that it is an enum like开发者_开发百科 this:[详细]
2023-02-04 19:08 分类:问答Switched Return
Essentially what I am liking to do here is make a templated function call where the caller essentially requests a given type and either a pointer or a reference will be passed back.Based on the type g[详细]
2023-02-01 15:48 分类:问答