Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-11-12 00:26:35


Sascha Krissler wrote:
> On Sat, Nov 11, 2006 at 06:16:26PM -0800, Eric Niebler wrote:
>> Sascha Krissler wrote:
>>> What i would like is:
>>>
>>> template <typename T, typename Container>
>>> struct Foo {
>>> typedef typename mpl::apply<Container, T>::type foo;
>>> };
>>>
>>> and instantiate it with:
>>>
>>> Foo<int, mpl::stl_foo::vector<mpl::placeholder::_1> >
>>>
>>> For that i need
>>>
>>> namespace boost::mpl::stl_foo {
>>> template <typename T, typename Alloc>
>>> struct vector {
>>> typedef std::vector<T, Alloc> type
>>> };
>>> }
>>>
>>> so i can curry containers as i wish.
>>>
>>> just an idea
>>
>> Try this instead:
>>
>> using mpl::_;
>> Foo< int, std::vector<_> >
>>
>> :-)
>>
> std::vector is not a metafunction, it has no ::type

It doesn't matter. Try it and see.

--
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk