Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #427

Alias Templates as Template Template arguments

From E Allen <allen.eric.m@gmail.com>
Newsgroups comp.std.c++
Subject Alias Templates as Template Template arguments
Date 2012-03-04 14:24 -0800
Organization http://groups.google.com
Message-ID <11319727.602.1330568315691.JavaMail.geo-discussion-forums@ynjd19> (permalink)

Show all headers | View raw


I saw some threads from prior to the final C++11 standard that seemed
to indicate that this would be legal. Now that things are finalized,
is the following, in fact, legal?

namespace MyLib {
template<typename T> class Normal_Traits { /* ... */ };

template<typename T, typename Traits = Normal_Traits<T>>
class Nifty_New_Container { /* ... */ };

template<template<typename> Con> class Widget { Con<int> ci; Con<void*> cp;
 /* ... use ci and cp in member functions */ };
}

template<typename T> using Adapter = MyLib::Nifty_New_Container<T>;

void foo() {
Widget<Adapter> w;
// use w
}


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextNext in thread | Find similar


Thread

Alias Templates as Template Template arguments E Allen <allen.eric.m@gmail.com> - 2012-03-04 14:24 -0800
  Re: Alias Templates as Template Template arguments Daniel Krügler<daniel.kruegler@googlemail.com> - 2012-03-05 11:18 -0800

csiph-web