metaprogramming
Use cases for Ruby's EOB construct
I recently came across the Ruby EOB / -EOB construct within this context (from the Ruby id3 library) :[详细]
2023-03-15 07:57 分类:问答Programmatically determine whether exceptions are enabled
Most C++ compilers allow for e开发者_JS百科xceptions to be disabled. Is there a way to determine it from the code without using compiler-specific preprocessor macros, such as _CPPUNWIND for MSVC? Idea[详细]
2023-03-15 07:51 分类:问答How to automatically infer the return type from a function type?
I\'m using boost::python to create a Python wrapper of a C++ library. At some point, boost::python needs a pointer to a member function (or something compatible), like:[详细]
2023-03-14 11:57 分类:问答meta-programming: inherit from every class in a boost mpl::vector
I wish to inherit from a set of classes contained in a boost mpl::vector.Is this possible? Specifically, I wish to extend test for arbitrary many template parameters, passed as a mpl::vector.[详细]
2023-03-14 08:06 分类:问答select_layout implementation Ruby meta programming
How to implement \"select_layout\" method so that I can transform this code: class Cpu::ContextsController < Cpu::ApplicationController[详细]
2023-03-14 07:14 分类:问答Help me with "template parameters not used in partial specialization"
I\'ve been struggling with NOT C++0x code, but regular C++. Don\'t ask me why I have to use regular C++, it\'s just some kind of silly requirement.[详细]
2023-03-14 06:18 分类:问答Getting the largest type available
How can I get the name of largest available type in my compiler?Is it possible at all? Something like:[详细]
2023-03-14 03:52 分类:问答Does template (meta)programming has always only one way of implementation?
Studying few of the t开发者_运维问答emplate programs and especially meta programs which deduce result at compile time into a constant, I learned that generally there is only one way to implement somet[详细]
2023-03-14 03:19 分类:问答Is there a standard construct for 'choose<bool,typename,typename>'?
I sometimes find myself in need for the following: template<bool B, typename T1, typename T2> struct choose{[详细]
2023-03-13 17:57 分类:问答How does this Array Size Template Work?
I came across this snippet template <typename T, size_t N> char (&ArraySizeHelper(T (&array)[N]))[N];[详细]
2023-03-13 17:25 分类:问答