$include_dir="/home/hyper-archives/boost/include";
include("$include_dir/msg-header.inc")
?>
- Next message: Beman Dawes: "Re: template template parameters (was Re: [boost] Re: Special functions, octonions, quaternions in the CVS)"
- Previous message: Beman Dawes: "RE: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Maybe in reply to: Aleksey Gurtovoy: "RE: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Next in thread: Roland Weiss: "Re: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Reply: Roland Weiss: "Re: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
Jeremy Siek wrote:
> Sure. The template template parameter workaround allows more
> flexibility in the template types that are used as parameters. For
> example, suppose the template parameter is a container:
>
> #include <vector>
>
> template <template <class U> class C>
> struct foo {
> struct bar { };
> C<bar> c;
> };
>
> int main()
> {
> foo<std::vector> f;
> return 0;
> }
>
>
> Now, what if we don't want to use the default allocator of
> std::vector, but some other allocator? How can we pass in std::vector into
> foo but also specify some other allocator? With template templates
> parameters you can not do this.
Actually, with template template parameters you cannot even do the above ;),
Comeau C/C++ 4.2.44 (Sep 30 2000 11:56:08) for _MS_WINDOWS_x86_BETA3
"E:\depot\libs\template_params.cpp", line 12: error #999: class template
"std::vector" is not compatible with template template parameter
"C"
foo<std::vector> f;
^
- Next message: Beman Dawes: "Re: template template parameters (was Re: [boost] Re: Special functions, octonions, quaternions in the CVS)"
- Previous message: Beman Dawes: "RE: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Maybe in reply to: Aleksey Gurtovoy: "RE: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Next in thread: Roland Weiss: "Re: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
- Reply: Roland Weiss: "Re: template template parameters (was Re: [boost] Re: Special fun ctions, octonions, quaternions in the CVS)"
$include_dir="/home/hyper-archives/boost/include";
include("$include_dir/msg-footer.inc");
?>