Fix: boost enable directory_iterator C++11 range-base for statement
This commit is contained in:
parent
504da0c1e6
commit
8f28ef26a0
@ -55,6 +55,37 @@
|
|||||||
#define NANA_USING_BOOST_FILESYSTEM 1
|
#define NANA_USING_BOOST_FILESYSTEM 1
|
||||||
# include <chrono>
|
# include <chrono>
|
||||||
# include <boost/filesystem.hpp>
|
# include <boost/filesystem.hpp>
|
||||||
|
// dont include generic_u8string
|
||||||
|
// http://www.boost.org/doc/libs/1_66_0/boost/filesystem/path.hpp
|
||||||
|
// enable directory_iterator C++11 range-base for
|
||||||
|
// http://www.boost.org/doc/libs/1_66_0/boost/filesystem/operations.hpp
|
||||||
|
// but travis come with an oooold version of boost
|
||||||
|
// NOT enable directory_iterator C++11 range-base for
|
||||||
|
// http://www.boost.org/doc/libs/1_54_0/boost/filesystem/operations.hpp
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace filesystem
|
||||||
|
{
|
||||||
|
|
||||||
|
// enable directory_iterator C++11 range-base for statement use --------------------//
|
||||||
|
|
||||||
|
// begin() and end() are only used by a range-based for statement in the context of
|
||||||
|
// auto - thus the top-level const is stripped - so returning const is harmless and
|
||||||
|
// emphasizes begin() is just a pass through.
|
||||||
|
inline
|
||||||
|
const directory_iterator& begin(const directory_iterator& iter) BOOST_NOEXCEPT
|
||||||
|
{
|
||||||
|
return iter;
|
||||||
|
}
|
||||||
|
inline
|
||||||
|
directory_iterator end(const directory_iterator&) BOOST_NOEXCEPT
|
||||||
|
{
|
||||||
|
return directory_iterator();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace filesystem
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// add boost::filesystem into std::experimental::filesystem
|
// add boost::filesystem into std::experimental::filesystem
|
||||||
namespace std {
|
namespace std {
|
||||||
@ -76,15 +107,15 @@ namespace std {
|
|||||||
unknown = boost::filesystem::file_type::type_unknown,
|
unknown = boost::filesystem::file_type::type_unknown,
|
||||||
};
|
};
|
||||||
/// enable directory_iterator range-based for statements
|
/// enable directory_iterator range-based for statements
|
||||||
inline directory_iterator begin(directory_iterator iter) noexcept
|
//inline directory_iterator begin(directory_iterator iter) noexcept
|
||||||
{
|
//{
|
||||||
return iter;
|
// return iter;
|
||||||
}
|
//}
|
||||||
|
|
||||||
inline directory_iterator end(const directory_iterator&) noexcept
|
//inline directory_iterator end(const directory_iterator&) noexcept
|
||||||
{
|
//{
|
||||||
return {};
|
// return {};
|
||||||
}
|
//}
|
||||||
} // filesystem
|
} // filesystem
|
||||||
} // experimental
|
} // experimental
|
||||||
} // std
|
} // std
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user