From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-01-26 00:07:00
The attached code attempts to use CRTP (Curiously Recurring Template
Pattern) to see if recursive_variant can be avoided; however,
I'm getting 2 variant's produced instead of 1 and the which gives
the wrong result.
The output is:
<-- cut here --
===>Enter:template<typename T>variant(T& operand)
===>Enter:template<typename T>convert_construct(T& operand,int,false)
===>Exit:template<typename T>convert_construct(T& operand,int,false)
===>Exit:template<typename T>variant(T& operand)
>-- cut here --
The output produced from just the attached includes:
but I expected which=1 since the CTOR arg is the 2nd bounded type:
(pair<int,list_type*>). The other output's are produced by
making object_tracked a super of variant and also putting
debug prints in various CTOR's. The output:
indicates a variant produced with the default CTOR has id=1 which is
the id of the vlist produced with the pair CTOR arg.
Does anyone have any clue why this is happening, IOW why which=0 instead
I tried using the debugger, but it was not more help.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk