Topic: Template aliases allow more deduction in conversion functions
Author: "Johannes Schaub (litb)" <schaub-johannes@web.de>
Date: Fri, 7 May 2010 17:55:28 CST Raw View
I found that the following is now possible in C++0x using template aliases
template<typename T>
using id = T;
struct Foo {
template<typename T, size_t N>
operator id<T[N]> &() { .. }
};
And it will deduce T and N to the proper values. Similar for function types.
That "solves" issue #395, i think.
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]