Skip to content

Commit ea0b97c

Browse files
committed
Work around u8path being deprecated in c++20
1 parent 24b0964 commit ea0b97c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/benchmark-larger/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ int main()
163163
<< std::endl;
164164
start = end;
165165
for (size_t i = 0; i < probe_size; ++i) {
166-
sum += objects[i].get<Int>(col2);
166+
sum = sum + objects[i].get<Int>(col2);
167167
}
168168
end = std::chrono::steady_clock::now();
169169
diff = end - start;

test/test_util_file.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,15 @@ TEST(Utils_File_dir)
117117

118118
TEST(Utils_File_dir_unicode)
119119
{
120+
#if __cplusplus < 202002L
120121
using std::filesystem::u8path;
122+
#else
123+
auto u8path = [](const std::string& str) {
124+
return std::filesystem::path(reinterpret_cast<const char8_t*>(str.c_str()));
125+
};
126+
#endif
121127

122-
constexpr char all_the_unicode[] = u8"фоо-бар Λορεμ ლორემ 植物 החלל جمعت søren";
128+
const char* all_the_unicode = (const char*)u8"фоо-бар Λορεμ ლორემ 植物 החלל جمعت søren";
123129
std::string dir_name = File::resolve(all_the_unicode, test_util::get_test_path_prefix());
124130

125131
// Create directory

0 commit comments

Comments
 (0)