os/ossrv/genericopenlibs/cppstdlib/stl/test/compiler/ttei5.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2  * It is known that this code not compiled by following compilers:
     3  *   gcc 3.4.1
     4  *
     5  * It is known that this code compiled by following compilers:
     6  *   gcc 2.95.3
     7  *   gcc 3.3.3
     8  *
     9  *   MSVC 6
    10  *   MSVC 8 Beta
    11  */
    12 
    13 /*
    14  * Indeed this code is wrong: explicit template specialization
    15  * have to appear out-of-class.
    16  *
    17  */
    18 
    19 struct A
    20 {
    21   private:
    22     struct B
    23     {
    24         template <typename T>
    25         static void f( T& ) {}
    26 
    27         template <bool V>
    28         struct C
    29         {
    30             template <typename T>
    31             static void f( T& ) {}
    32         };
    33 
    34         template <>
    35         struct C<true>
    36         {
    37             template <typename T>
    38             static void f( T& ) {}
    39         };
    40     };
    41 };
    42