"Rozental, Gennadiy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > If anyone interested I have more generic solution, that
> > includes both

[...snip...]

> namespace mapping {
> template<class Key, class Value, class ImplPolicy >
> class fixed_sized;
>
> // constructed by Key1,Value1,Key2,Value2 ... list plus "invalid value"
>
> template<class Key, class Value, class ImplPolicy >
> class dynamic;
>
> // constrcted by "invalid_value"
>


"invalid_value" ... is what / defined how?

> };
>
> mapping::fixed_sized<const_string,int,array_impl_policy> test_mapping1(
>     "Key1", 1,
>     "Key2", 2,
>     "QWE", 3,
>     0
> );
>
> mapping::dyanamic<const_string,int,map_impl_policy> test_mapping2(
>     "Key1", 1,
>     "Key2", 2,
>     "QWE", 3,
>     0
> );

What would the actual signature of the constructor be in this case?

>
> mapping::dynamic<const_string,int,map_impl_policy > test_mapping3( 0 );
> test_mapping3.add( "Key1", 1 );
> test_mapping3.add( "Key2", 2 );
> test_mapping3.add( "QWE" , 3 );
>
> Usage:
> test_mapping1["Key1"]
> test_mapping2["Key2"]
> test_mapping3["QWE"]
>

And reverse lookup? Does it require another template instantiation with the
first two parameters defined in reverse order, or is it included through
operator [] overloading, or ...?

// Johan





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to