std::wstring1 C++11 기준 문자열 format 함수 (std::string/std::wstring) C++11 문법 기준으로 문자열을 formatting 하는 템플릿 함수를 만들어봤다. 메모 겸 올려본다. (C++20부터는 std::format이 추가되었으므로 그걸 쓰면 된다.) 기본적인 틀은 아래 글을 참고하여 작성했다. https://stackoverflow.com/questions/2342162/stdstring-formatting-like-sprintf 참고한 코드 대비해서 좋은 점은 아래와 같다. 1. std::string, std::wstring에 대해 모두 사용가능 2. 참고한 코드 대비 메모리 할당/복사가 적음 format.hpp #include #include #include #if defined _MSC_VER && _MSC_VER 2021. 12. 13. 이전 1 다음