|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62976 - trunk/boost/filesystem/v3
From: bdawes_at_[hidden]
Date: 2010-06-15 11:40:05
Author: bemandawes
Date: 2010-06-15 11:40:04 EDT (Tue, 15 Jun 2010)
New Revision: 62976
URL: http://svn.boost.org/trac/boost/changeset/62976
Log:
Reorder code to workaround clang problem (Chris Jefferson)
Text files modified:
trunk/boost/filesystem/v3/path_traits.hpp | 131 ++++++++++++++++++++-------------------
1 files changed, 66 insertions(+), 65 deletions(-)
Modified: trunk/boost/filesystem/v3/path_traits.hpp
==============================================================================
--- trunk/boost/filesystem/v3/path_traits.hpp (original)
+++ trunk/boost/filesystem/v3/path_traits.hpp 2010-06-15 11:40:04 EDT (Tue, 15 Jun 2010)
@@ -56,71 +56,6 @@
bool empty(T (&)[N])
{ return N <= 1; }
- // Source dispatch
-
- // contiguous containers
- template <class U> inline
- void dispatch(const std::string& c, U& to, const codecvt_type& cvt)
- {
- if (c.size())
- convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
- }
- template <class U> inline
- void dispatch(const std::wstring& c, U& to, const codecvt_type& cvt)
- {
- if (c.size())
- convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
- }
- template <class U> inline
- void dispatch(const std::vector<char>& c, U& to, const codecvt_type& cvt)
- {
- if (c.size())
- convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
- }
- template <class U> inline
- void dispatch(const std::vector<wchar_t>& c, U& to, const codecvt_type& cvt)
- {
- if (c.size())
- convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
- }
-
- // non-contiguous containers
- template <class Container, class U> inline
- void dispatch(const Container & c, U& to, const codecvt_type& cvt)
- {
- if (c.size())
- {
- std::basic_string<typename Container::value_type> s(c.begin(), c.end());
- convert(s.c_str(), s.c_str()+s.size(), to, cvt);
- }
- }
-
- // c_str
- template <class T, class U> inline
- void dispatch(T * const & c_str, U& to, const codecvt_type& cvt)
- {
-// std::cout << "dispatch() const T *\n";
- BOOST_ASSERT(c_str);
- convert(c_str, to, cvt);
- }
-
- // C-style array
- template <typename T, size_t N, class U> inline
- void dispatch(T (&array)[N], U& to, const codecvt_type& cvt) // T, N, U deduced
- {
-// std::cout << "dispatch() array, N=" << N << "\n";
- convert(array, array + N - 1, to, cvt);
- }
-
- BOOST_FILESYSTEM_DECL
- void dispatch(const directory_entry & de,
-# ifdef BOOST_WINDOWS_API
- std::wstring & to,
-# else
- std::string & to,
-# endif
- const codecvt_type&);
-
// value types differ ---------------------------------------------------------------//
//
// A from_end argument of 0 is less efficient than a known end, so use only if needed
@@ -197,6 +132,72 @@
to += from;
}
+ // Source dispatch
+
+ // contiguous containers
+ template <class U> inline
+ void dispatch(const std::string& c, U& to, const codecvt_type& cvt)
+ {
+ if (c.size())
+ convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
+ }
+ template <class U> inline
+ void dispatch(const std::wstring& c, U& to, const codecvt_type& cvt)
+ {
+ if (c.size())
+ convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
+ }
+ template <class U> inline
+ void dispatch(const std::vector<char>& c, U& to, const codecvt_type& cvt)
+ {
+ if (c.size())
+ convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
+ }
+ template <class U> inline
+ void dispatch(const std::vector<wchar_t>& c, U& to, const codecvt_type& cvt)
+ {
+ if (c.size())
+ convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
+ }
+
+ // non-contiguous containers
+ template <class Container, class U> inline
+ void dispatch(const Container & c, U& to, const codecvt_type& cvt)
+ {
+ if (c.size())
+ {
+ std::basic_string<typename Container::value_type> s(c.begin(), c.end());
+ convert(s.c_str(), s.c_str()+s.size(), to, cvt);
+ }
+ }
+
+ // c_str
+ template <class T, class U> inline
+ void dispatch(T * const & c_str, U& to, const codecvt_type& cvt)
+ {
+// std::cout << "dispatch() const T *\n";
+ BOOST_ASSERT(c_str);
+ convert(c_str, to, cvt);
+ }
+
+ // C-style array
+ template <typename T, size_t N, class U> inline
+ void dispatch(T (&array)[N], U& to, const codecvt_type& cvt) // T, N, U deduced
+ {
+// std::cout << "dispatch() array, N=" << N << "\n";
+ convert(array, array + N - 1, to, cvt);
+ }
+
+ BOOST_FILESYSTEM_DECL
+ void dispatch(const directory_entry & de,
+# ifdef BOOST_WINDOWS_API
+ std::wstring & to,
+# else
+ std::string & to,
+# endif
+ const codecvt_type&);
+
+
}}} // namespace boost::filesystem::path_traits
//----------------------------------------------------------------------------//
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