mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-07-22 04:54:26 +08:00
Test for workaround of static constexpr issue
This commit is contained in:
parent
135015f20b
commit
cbe0c61492
@ -192,24 +192,35 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 30.10.8 class path
|
template<typename char_type>
|
||||||
class GHC_FS_API_CLASS path
|
class path_helper_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
using value_type = char_type;
|
||||||
#ifdef GHC_OS_WINDOWS
|
#ifdef GHC_OS_WINDOWS
|
||||||
#ifdef GHC_WIN_WSTRING_STRING_TYPE
|
|
||||||
#define GHC_USE_WCHAR_T
|
|
||||||
using value_type = std::wstring::value_type;
|
|
||||||
#else
|
|
||||||
using value_type = std::string::value_type;
|
|
||||||
#endif
|
|
||||||
using string_type = std::basic_string<value_type>;
|
|
||||||
static constexpr value_type preferred_separator = '\\';
|
static constexpr value_type preferred_separator = '\\';
|
||||||
#else
|
#else
|
||||||
using value_type = std::string::value_type;
|
|
||||||
using string_type = std::basic_string<value_type>;
|
|
||||||
static constexpr value_type preferred_separator = '/';
|
static constexpr value_type preferred_separator = '/';
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename char_type>
|
||||||
|
constexpr char_type path_helper_base<char_type>::preferred_separator;
|
||||||
|
|
||||||
|
// 30.10.8 class path
|
||||||
|
class GHC_FS_API_CLASS path
|
||||||
|
#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_WSTRING_STRING_TYPE)
|
||||||
|
#define GHC_USE_WCHAR_T
|
||||||
|
: private path_helper_base<std::wstring::value_type>
|
||||||
|
#else
|
||||||
|
: private path_helper_base<std::string::value_type>
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using path_helper_base::value_type;
|
||||||
|
using string_type = std::basic_string<value_type>;
|
||||||
|
using path_helper_base::preferred_separator;
|
||||||
|
|
||||||
// 30.10.10.1 enumeration format
|
// 30.10.10.1 enumeration format
|
||||||
/// The path format in wich the constructor argument is given.
|
/// The path format in wich the constructor argument is given.
|
||||||
enum format {
|
enum format {
|
||||||
|
@ -345,6 +345,15 @@ TEST_CASE("fs::detail::toUtf8", "[filesystem][fs.detail.utf8]")
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TEST_CASE("30.10.8.1 path::preferred_separator", "[filesystem][path][fs.path.generic]")
|
||||||
|
{
|
||||||
|
#ifdef GHC_OS_WINDOWS
|
||||||
|
CHECK(fs::path::preferred_separator == '\\');
|
||||||
|
#else
|
||||||
|
CHECK(fs::path::preferred_separator == '/');
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef GHC_OS_WINDOWS
|
#ifndef GHC_OS_WINDOWS
|
||||||
TEST_CASE("30.10.8.1 path(\"//host\").has_root_name()", "[filesystem][path][fs.path.generic]")
|
TEST_CASE("30.10.8.1 path(\"//host\").has_root_name()", "[filesystem][path][fs.path.generic]")
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user