- /*
- * Compile and run with
- * rm -f a.exe* ; clang++ -target x86_64-w64-mingw32 -std=c++17 -Bstatic c++pmr1.cpp
- * $ PATH+=':/usr/x86_64-w64-mingw32/sys-root/mingw/bin/' ./a.exe
- */
- #include <array>
- #include <cstddef>
- #include <iostream>
- #include <memory_resource>
- int main(int ac, char *av[])
- {
- constexpr int total_mem{8192};
- std::array<std::byte, total_mem> buf;
- std::pmr::monotonic_buffer_resource pool{buf.data(), buf.size()};
- std::pmr::string s{"x", &pool};
- for (int i=0 ; i < 8 ; i++) {
- s = s + s;
- }
- std::cout << s << std::endl;
- return EXIT_SUCCESS;
- }
C++17 PMR test1
Posted by Anonymous on Wed 3rd Jul 2024 00:19
raw | new post
view followups (newest first): C++17 PMR test2 by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.