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.
sl@0
     1
/*
sl@0
     2
 * It is known that this code not compiled by following compilers:
sl@0
     3
 *   gcc 3.4.1
sl@0
     4
 *
sl@0
     5
 * It is known that this code compiled by following compilers:
sl@0
     6
 *   gcc 2.95.3
sl@0
     7
 *   gcc 3.3.3
sl@0
     8
 *
sl@0
     9
 *   MSVC 6
sl@0
    10
 *   MSVC 8 Beta
sl@0
    11
 */
sl@0
    12
sl@0
    13
/*
sl@0
    14
 * Indeed this code is wrong: explicit template specialization
sl@0
    15
 * have to appear out-of-class.
sl@0
    16
 *
sl@0
    17
 */
sl@0
    18
sl@0
    19
struct A
sl@0
    20
{
sl@0
    21
  private:
sl@0
    22
    struct B
sl@0
    23
    {
sl@0
    24
        template <typename T>
sl@0
    25
        static void f( T& ) {}
sl@0
    26
sl@0
    27
        template <bool V>
sl@0
    28
        struct C
sl@0
    29
        {
sl@0
    30
            template <typename T>
sl@0
    31
            static void f( T& ) {}
sl@0
    32
        };
sl@0
    33
sl@0
    34
        template <>
sl@0
    35
        struct C<true>
sl@0
    36
        {
sl@0
    37
            template <typename T>
sl@0
    38
            static void f( T& ) {}
sl@0
    39
        };
sl@0
    40
    };
sl@0
    41
};
sl@0
    42