template-meta-programming
Is it possible to do compile-time execution in OCaml, similar to C++ template metaprogramming?
In C++, recursive templates and constant values as temp开发者_开发问答late parameters allows to do interesting examples of code generation and compile-time execution, such as the factorial.[详细]
2023-04-11 07:07 分类:问答Template specialization for a range of values [duplicate]
This question already has answers here: Integer range based template specialisation [duplicate] (3 answers)[详细]
2023-04-10 21:29 分类:问答Compile-time constant id
Given the following: template<typenam开发者_开发百科e T> class A { public: static const unsigned int ID = ?;[详细]
2023-04-08 19:40 分类:问答type wrapper error with boost::mpl::for_each (section 9.1.1 from Abrahams & Gurtovoy book)
The following code is copied almost verbatim from section 9.1.1 of the book C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond by David Abrahams & Aleksey Gurtovoy[详细]
2023-04-07 21:02 分类:问答C++ method template specialization for only one index
I\'d like to perform a template specialization for only one index of a class.For example, in the following code I want to create a specialization whenever the first class is int, regardless of what th[详细]
2023-04-04 05:10 分类:问答How to "dereference a type" in C++03?
How do I get the \"dereferenced type\" of another type in C++03?Note that it can be other dereferenceable type like std::vector<int>::iterator.[详细]
2023-04-02 15:33 分类:问答How does this meta-programming compile down?
Here\'s an example from wikipedia that displays C++ template meta-programming: template <int N> struct Factorial[详细]
2023-04-01 08:36 分类:问答Automatically pick a variable type big enough to hold a specified number
Is there any way in C++ define a type that is big enough to hold at most a specific number, presumably using some clever template code. For example I want to be able to write :-[详细]
2023-03-27 21:08 分类:问答How to find, from which Types is object composed of?
ok, yesterday I posted almost identical question here , but I wasn\'t able to modify the answer(working) to my needs... I did not want to mess the other topic, so I have started new one.[详细]
2023-03-27 06:52 分类:问答Getting the pointer in C++ for a class that is part of another class with multiple inheritance
I have some classes that inherit from each other but they do so using templates. What I want is to effectively get a pointer and/or reference to one of the base classes as if it is one of the other po[详细]
2023-03-24 09:27 分类:问答