Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65564 - sandbox/conversion/libs/conversion/test
From: vicente.botet_at_[hidden]
Date: 2010-09-23 17:55:28


Author: viboes
Date: 2010-09-23 17:55:27 EDT (Thu, 23 Sep 2010)
New Revision: 65564
URL: http://svn.boost.org/trac/boost/changeset/65564

Log:
Conversion: Fix ADL issue
Text files modified:
   sandbox/conversion/libs/conversion/test/Jamfile.v2 | 23 ++++++++-----------
   sandbox/conversion/libs/conversion/test/helper.hpp | 45 ++++++++++++++++++++++++++++++---------
   sandbox/conversion/libs/conversion/test/intrinsec.cpp | 8 +++---
   sandbox/conversion/libs/conversion/test/optional.cpp | 4 +-
   4 files changed, 50 insertions(+), 30 deletions(-)

Modified: sandbox/conversion/libs/conversion/test/Jamfile.v2
==============================================================================
--- sandbox/conversion/libs/conversion/test/Jamfile.v2 (original)
+++ sandbox/conversion/libs/conversion/test/Jamfile.v2 2010-09-23 17:55:27 EDT (Thu, 23 Sep 2010)
@@ -1,5 +1,5 @@
 #
-# Boost.Synchro
+# Boost.Conversion
 # Build script for tests.
 #
 # Copyright (c) 2008-2009 Vicente J. Botet Escriba]
@@ -17,22 +17,19 @@
 
 project :
     : requirements
-# <include>$BOOST_ROOT
-# <include>../../..
-# <include>../../../../chrono
-
-# <threading>multi
-# <target-os>cygwin
- #<threadapi>pthread
-# <variant>debug
-
         <library>/boost/system//boost_system
         <library>/boost/chrono//boost_chrono
-
         #<library>/boost/thread//boost_thread/<link>static
-
         <library>/boost/test//boost_unit_test_framework/<link>static
- #<library>/boost/test//boost_unit_test_framework
+
+ <toolset>msvc:<asynch-exceptions>on
+ <define>BOOST_ENABLE_WARNINGS
+ <warnings>all
+ <toolset>gcc:<cxxflags>-Wextra
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>msvc:<cxxflags>/wd4127
 
 ;
 

Modified: sandbox/conversion/libs/conversion/test/helper.hpp
==============================================================================
--- sandbox/conversion/libs/conversion/test/helper.hpp (original)
+++ sandbox/conversion/libs/conversion/test/helper.hpp 2010-09-23 17:55:27 EDT (Thu, 23 Sep 2010)
@@ -18,33 +18,56 @@
 struct A2{};
 struct B1{};
 struct B2{};
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
 
 namespace boost {
- A1 convert_to(const B1& val, boost::dummy::type_tag<A1> const&) {
- return A1();
- }
-
- A1& assign_to(A1& to, const B1& from, boost::dummy::type_tag<A1> const&) {
- return to;
- }
-
     namespace conversion { namespace partial_specialization_workaround {
         template <>
+ struct convert_to< A1,B1 > {
+ inline static A1 apply(B1 const &)
+ {
+ return A1();
+ }
+ };
+ template < >
+ struct assign_to< A1,B1 > {
+ inline static A1& apply(A1& to, const B1&)
+ {
+ return to;
+ }
+ };
+ template <>
         struct convert_to< A2,B2 > {
- inline static A2 apply(B2 const & from)
+ inline static A2 apply(B2 const &)
             {
                 return A2();
             }
         };
         template < >
         struct assign_to< A2,B2 > {
- inline static A2& apply(A2& to, const B2& from)
+ inline static A2& apply(A2& to, const B2&)
             {
                 return to;
             }
         };
     }
- }
 }
+#else
+ A1 convert_to(const B1&, boost::dummy::type_tag<A1> const&) {
+ return A1();
+ }
+
+ A1& assign_to(A1& to, const B1&, boost::dummy::type_tag<A1> const&) {
+ return to;
+ }
+ A2 convert_to(const B2&, boost::dummy::type_tag<A2> const&) {
+ return A2();
+ }
+
+ A2& assign_to(A2& to, const B2&, boost::dummy::type_tag<A2> const&) {
+ return to;
+ }
 
+#endif
 #endif //BOOST_CONVERSION_TEST_HELPER__HPP

Modified: sandbox/conversion/libs/conversion/test/intrinsec.cpp
==============================================================================
--- sandbox/conversion/libs/conversion/test/intrinsec.cpp (original)
+++ sandbox/conversion/libs/conversion/test/intrinsec.cpp 2010-09-23 17:55:27 EDT (Thu, 23 Sep 2010)
@@ -19,14 +19,14 @@
 struct B{};
 struct A {
     A(int){};
- A(const B&b){};
+ A(const B&){};
 };
 struct AE {
- explicit AE(const B&b){};
+ explicit AE(const B&){};
 };
 struct AA {
     AA(int){};
- AA& operator=(const A&a) { return *this;}
+ AA& operator=(const A&) { return *this;}
 };
 
 struct C {
@@ -34,7 +34,7 @@
 };
 struct CC {
     CC(int){};
- CC& operator=(const B&b) { return *this;}
+ CC& operator=(const B&) { return *this;}
 };
 
 void convert_to_with_implicit_constructor() {

Modified: sandbox/conversion/libs/conversion/test/optional.cpp
==============================================================================
--- sandbox/conversion/libs/conversion/test/optional.cpp (original)
+++ sandbox/conversion/libs/conversion/test/optional.cpp 2010-09-23 17:55:27 EDT (Thu, 23 Sep 2010)
@@ -18,11 +18,11 @@
 
     struct A1{};
     struct B1{};
- A1 convert_to(const B1& val, boost::dummy::type_tag<A1> const&) {
+ A1 convert_to(const B1&, boost::dummy::type_tag<A1> const&) {
         return A1();
     }
 
- A1& assign_to(A1& to, const B1& from) {
+ A1& assign_to(A1& to, const B1&) {
         return to;
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk