15 Jul
2014
15 Jul
'14
12:15 p.m.
On 15/07/14 08:04, Michael Shepanski wrote:
1. If you want some class to be mapped into SQL data, quince lets you write this sort of thing:
struct point { float x; float y; }; QUINCE_MAP_CLASS(point, (x)(y))
extern database db; table<point> points(db, "points");
The macro QUINCE_MAP_CLASS uses a bit of Boost.Preprocessor magic and a bit of template metaprogramming to produce all the statically typed metadata that quince needs, regarding the user's type. There is no code generation step.
There are already macros to do this in Boost Fusion. Why not re-use them? Boost.Fusion is a tuple manipulation library initially developed for a parser generator EDSL.