The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
0answers
110 views

C++ compile-time checked switch 'statement'

In the project I work on there are several places where a switch statement is used on a type enum. (I know, better to use virtual functions or a visitor pattern or something, but sometimes switching ...
3
votes
1answer
140 views

Could this deferred execution scheme be any simpler?

I've created this scheme to preserve function calls until all the arguments are available. The stub_op classes will be replaced with classes that implement a forward-like mechanism that receives ...
3
votes
0answers
75 views

Type to instance map

I needed a class where I could store an instance of any type. The goal was an interface as follows: class TypeMap { template<typename T> T& get(); }; Such that: Iff &m1 == ...
0
votes
1answer
299 views

Review of C++ singleton

Originally posted on Stack Overflow. So far, I've used this in a few places and it seems solid. This is what I usually do to make a singleton: // Assume x86 for now #ifdef _MSC_VER #include ...
2
votes
0answers
786 views

JSON Serializer

Carrying on from: Yet another C++ Json Parser Yet another C++ Json Parser (Recursive) All the code is available from git hub: ThorsSerializer but only reviewing a small section here. The idea is ...
1
vote
1answer
124 views

How can I improve the design of this serialization mechanism?

I'm working on caching library which is intended to work with all types of values. Values are represented as instances of value_type: value_type holds a std::vector<char> for the raw data, and ...
1
vote
0answers
122 views

Variadic function with restricted types

I am designing a class which (among other things) acts as a vertex in an undirected graph. #include <iterator> #include <string> class Node { public: explicit Node(const ...
9
votes
1answer
294 views

D2.0 mixin and template-heavy code - Building a silverlight clone

Update : The code is on github for anyone interested. I know it's not very useful but I'm having fun with it. link I've made a mock version of silverlight in D2. It is meant to output html but ...
3
votes
1answer
326 views

Meta-program to find square numbers

I'm new to template meta-programming and wrote some code to determine if a number is a perfect square. For example, in my program, SQUARE<1>::value and SQUARE<4>::value evaluate to true ...