os/ossrv/genericopenlibs/cppstdlib/stl/test/compiler/ttei3.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/compiler/ttei3.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,42 @@
     1.4 +/*
     1.5 + * It is known that this code not compiled by following compilers:
     1.6 + *   gcc 2.95.3
     1.7 + *   gcc 3.3.3
     1.8 + *   gcc 3.4.1
     1.9 + *
    1.10 + * It is known that this code compiled by following compilers:
    1.11 + *
    1.12 + *   MSVC 6
    1.13 + *   MSVC 8 Beta
    1.14 + */
    1.15 +
    1.16 +/*
    1.17 + * Indeed this code is wrong: explicit template specialization
    1.18 + * have to appear out-of-class.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +struct A
    1.23 +{
    1.24 +  private:
    1.25 +    struct B
    1.26 +    {
    1.27 +        template <typename T>
    1.28 +        static void f( T& ) {}
    1.29 +
    1.30 +        template <bool V>
    1.31 +        struct C
    1.32 +        {
    1.33 +            template <typename T>
    1.34 +            static void f( T& ) {}
    1.35 +        };
    1.36 +
    1.37 +        template <>
    1.38 +        struct C<true>
    1.39 +        {
    1.40 +            template <typename T>
    1.41 +            static void f( T& ) {}
    1.42 +        };
    1.43 +    };
    1.44 +};
    1.45 +