A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/temp.class.order below:

[temp.class.order]

For two class template partial specializations, the first is more specialized than the second if, given the following rewrite to two function templates, the first function template is more specialized than the second according to the ordering rules for function templates:

[Example:

template<int I, int J, class T> class X { };
template<int I, int J>          class X<I, J, int> { };         template<int I>                 class X<I, I, int> { };         
template<int I0, int J0> void f(X<I0, J0, int>);                template<int I0>         void f(X<I0, I0, int>);                
template <auto v>    class Y { };
template <auto* p>   class Y<p> { };                            template <auto** pp> class Y<pp> { };                           
template <auto* p0>   void g(Y<p0>);                            template <auto** pp0> void g(Y<pp0>);                           

According to the ordering rules for function templates, the function template B is more specialized than the function template A and the function template D is more specialized than the function template C. Therefore, the partial specialization #2 is more specialized than the partial specialization #1 and the partial specialization #4 is more specialized than the partial specialization #3. end example]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4