- /*
- * 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[])
- {
- char buffer[64];
- std::pmr::monotonic_buffer_resource pool{buffer, sizeof(buffer)};
- std::pmr::polymorphic_allocator<char> pa{&pool};
- std::pmr::string s{"x", pa};
- for (int i=0 ; i < 10 ; i++) {
- s+=s;
- }
- std::cout << s << std::endl;
- return EXIT_SUCCESS;
- }
C++17 PMR test2
Posted by Anonymous on Wed 3rd Jul 2024 00:56
raw | new post
modification of post by Anonymous (view diff)
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.