From 86e1ddeacd908678348ff9783263fce47dc20179 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 12 Jan 2009 17:02:20 +0000 Subject: [PATCH] Filesystem: add specializations to eliminate warnings, thus fixing #2543 [SVN r50556] --- include/boost/filesystem/path.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index 13b1923..b3e4158 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -97,8 +97,9 @@ namespace boost { BOOST_STATIC_CONSTANT( bool, value = true ); }; # endif - // these only have to be specialized if Path::string_type::value_type - // is not convertible from char + // These only have to be specialized if Path::string_type::value_type + // is not convertible from char, although specializations may eliminate + // compiler warnings. See ticket 2543. template struct slash { BOOST_STATIC_CONSTANT( char, value = '/' ); }; @@ -108,9 +109,22 @@ namespace boost template struct colon { BOOST_STATIC_CONSTANT( char, value = ':' ); }; +# ifndef BOOST_FILESYSTEM_NARROW_ONLY + template<> struct slash + { BOOST_STATIC_CONSTANT( wchar_t, value = L'/' ); }; + template<> struct dot + { BOOST_STATIC_CONSTANT( wchar_t, value = L'.' ); }; + template<> struct colon + { BOOST_STATIC_CONSTANT( wchar_t, value = L':' ); }; +# endif + # ifdef BOOST_WINDOWS_PATH template struct path_alt_separator { BOOST_STATIC_CONSTANT( char, value = '\\' ); }; +# ifndef BOOST_FILESYSTEM_NARROW_ONLY + template<> struct path_alt_separator + { BOOST_STATIC_CONSTANT( wchar_t, value = L'\\' ); }; +# endif # endif // workaround for VC++ 7.0 and earlier issues with nested classes