From 5ee7e4812d4a6b21012acbb0b48c41b4d699ab2d Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Wed, 28 Oct 2009 21:07:47 +0000 Subject: [PATCH] see #3501: Reusing concepts from different compile units yields multiple defined symbols (Incomplete) * removed inlines that were added with the last commit * added anonymous namespace to make functions local to compilation unit svn path=/trunk/boost/numeric/ublas/; revision=57202 --- .../boost/numeric/ublas/detail/concepts.hpp | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/include/boost/numeric/ublas/detail/concepts.hpp b/include/boost/numeric/ublas/detail/concepts.hpp index ce99744b..8133670c 100644 --- a/include/boost/numeric/ublas/detail/concepts.hpp +++ b/include/boost/numeric/ublas/detail/concepts.hpp @@ -634,77 +634,70 @@ namespace boost { namespace numeric { namespace ublas { } }; + /** introduce anonymous namespace to make following functions + * local to the current compilation unit. + */ + namespace { + template T ZeroElement (T); template<> - BOOST_UBLAS_INLINE float ZeroElement (float) { return 0.f; } template<> - BOOST_UBLAS_INLINE double ZeroElement (double) { return 0.; } template<> - BOOST_UBLAS_INLINE vector ZeroElement (vector) { return zero_vector (); } template<> - BOOST_UBLAS_INLINE vector ZeroElement (vector) { return zero_vector (); } template<> - BOOST_UBLAS_INLINE matrix ZeroElement (matrix) { return zero_matrix (); } template<> - BOOST_UBLAS_INLINE matrix ZeroElement (matrix) { return zero_matrix (); } template<> - BOOST_UBLAS_INLINE std::complex ZeroElement (std::complex) { return std::complex (0.f); } template<> - BOOST_UBLAS_INLINE std::complex ZeroElement (std::complex) { return std::complex (0.); } template<> - BOOST_UBLAS_INLINE vector > ZeroElement (vector >) { return zero_vector > (); } template<> - BOOST_UBLAS_INLINE vector > ZeroElement (vector >) { return zero_vector > (); } template<> - BOOST_UBLAS_INLINE matrix > ZeroElement (matrix >) { return zero_matrix > (); } template<> - BOOST_UBLAS_INLINE matrix > ZeroElement (matrix >) { return zero_matrix > (); @@ -714,49 +707,41 @@ namespace boost { namespace numeric { namespace ublas { T OneElement (T); template<> - BOOST_UBLAS_INLINE float OneElement (float) { return 1.f; } template<> - BOOST_UBLAS_INLINE double OneElement (double) { return 1.; } template<> - BOOST_UBLAS_INLINE matrix OneElement (matrix) { return identity_matrix (); } template<> - BOOST_UBLAS_INLINE matrix OneElement (matrix) { return identity_matrix (); } template<> - BOOST_UBLAS_INLINE std::complex OneElement (std::complex) { return std::complex (1.f); } template<> - BOOST_UBLAS_INLINE std::complex OneElement (std::complex) { return std::complex (1.); } template<> - BOOST_UBLAS_INLINE matrix > OneElement (matrix >) { return identity_matrix > (); } template<> - BOOST_UBLAS_INLINE matrix > OneElement (matrix >) { return identity_matrix > (); @@ -908,7 +893,6 @@ namespace boost { namespace numeric { namespace ublas { } }; - BOOST_UBLAS_INLINE void concept_checks () { // Allow tests to be group to keep down compiler storage requirement @@ -1549,6 +1533,8 @@ namespace boost { namespace numeric { namespace ublas { #endif } + } // end of anonymous namespace + }}} #endif