metaprogramming
Encrypting / obfuscating a string literal at compile-time
I want to encrypt/encode a string at compile time so that the original string does not appear in the compiled executable.[详细]
2023-03-24 21:44 分类:问答Tag dispatch versus static methods on partially specialised classes
Suppose I want to write a generic function void f<T>(), which does one thing if T is a POD type and another thing if T is non-POD (or any other arbitrary predicate).[详细]
2023-03-24 12:25 分类:问答Ruby initialize: why doesn't it execute my read instruction
This is code from the day 3 of the Ruby section of 7 programming languages in 7 weeks. I can\'t get it to output anything if I don\'t write m.read just after m = RubyCsv.new[详细]
2023-03-24 08:27 分类:问答Passing/binding arguments when using boost::fusion::for_each
I would like to call a function on all elements of a boost::fusion::vector.The elements are开发者_开发知识库 of types like this:[详细]
2023-03-24 06:09 分类:问答Is it necessary to specialize whole class, when differs just with few members?
I am designing class, which is almost the same for 2d and 3d, so I am trying to use templates, to create it as one class typed by vector type (2d od 3d)[详细]
2023-03-24 03:16 分类:问答Ruby: Raise error in Module if class method not found
I would like to put some code in module that throws an error if certain method is not defined. This module relies on the external definition of this method, since this method\'s implementation is diff[详细]
2023-03-24 01:13 分类:问答Python and Smalltalk - Metaprogramming capabilities comparison
I have of late been learning Python, and am amazed by its superb runtime metaprogramming capabilities. Previously I came across the term \'runtime metaprogramming\' was when I was reading about Smallt[详细]
2023-03-23 22:16 分类:问答Store procs in a hash (lots of them)
I may be into a situation where I might potentially have hundreds or maybe thousands of blocks within a program, being indexed by a hash. I\'m experimenting with metaprogramming and I\'m wondering if[详细]
2023-03-22 17:36 分类:问答Source compiles in GCC but not Visual Studio
This compiles on GCC 4.6 but doesn\'t with VS2010 sp1: Is it my fault or VS screwed up again? #include \"stdafx.h\"[详细]
2023-03-22 05:36 分类:问答better than enum
I\'ve a lot of data and inside a loop I need to put a selection. Every entry is a physics event. In every event there is only one particle with its properties:[详细]
2023-03-22 05:27 分类:问答