Index: libs/config/test/boost_no_sfinae.cxx =================================================================== RCS file: /cvsroot/boost/boost/libs/config/test/boost_no_sfinae.cxx,v retrieving revision 1.1 diff -u -r1.1 boost_no_sfinae.cxx --- libs/config/test/boost_no_sfinae.cxx 3 Dec 2003 19:26:15 -0000 1.1 +++ libs/config/test/boost_no_sfinae.cxx 11 Dec 2003 12:38:45 -0000 @@ -1,68 +1,68 @@ -// (C) Copyright Eric Friedman 2003. -// Some modifications by Jeremiah Willcock and Jaakko Järvi. -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// MACRO: BOOST_NO_SFINAE -// TITLE: SFINAE (substitution failure is not an error) -// DESCRIPTION: SFINAE not supported. - - -namespace boost_no_sfinae { - -namespace f1_a { -template -int f1(T*, float) -{ - return 0; -} -} using f1_a::f1; - -namespace f1_b { -template -int f1(T*, int, typename T::int_* = 0) -{ - return 1; -} -} using f1_b::f1; - -namespace f2_a { -template -int f2(T*, float) -{ - return 2; -} -} using f2_a::f2; - -namespace f2_b { -template -typename T::int_ f2(T*, int) -{ - return 3; -} -} using f2_b::f2; - -struct test_t -{ - typedef int int_; -}; - -struct test2_t {}; - -int test() -{ - test_t* t = 0; - test2_t* t2 = 0; - bool correct = - (f1(t, 0) == 1) && - (f1(t2, 0) == 0) && - (f2(t, 0) == 3) && - (f2(t2, 0) == 2); - return !correct; -} - -} - - - +// (C) Copyright Eric Friedman 2003. +// Some modifications by Jeremiah Willcock and Jaakko Järvi. +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// MACRO: BOOST_NO_SFINAE +// TITLE: SFINAE (substitution failure is not an error) +// DESCRIPTION: SFINAE not supported. + + +namespace boost_no_sfinae { + +namespace f1_a { +template +int f1(T*, float) +{ + return 0; +} +} using f1_a::f1; + +namespace f1_b { +template +int f1(T*, int, typename T::int_* = 0) +{ + return 1; +} +} using f1_b::f1; + +namespace f2_a { +template +int f2(T*, float) +{ + return 2; +} +} using f2_a::f2; + +namespace f2_b { +template +typename T::int_ f2(T*, int) +{ + return 3; +} +} using f2_b::f2; + +struct test_t +{ + typedef int int_; +}; + +struct test2_t {}; + +int test() +{ + test_t* t = 0; + test2_t* t2 = 0; + bool correct = + (f1(t, 0) == 1) && + (f1(t2, 0) == 0) && + (f2(t, 0) == 3) && + (f2(t2, 0) == 2); + return !correct; +} + +} + + +