diff options
Diffstat (limited to 'modules/lang/c++/c_helper.hpp')
-rw-r--r-- | modules/lang/c++/c_helper.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/lang/c++/c_helper.hpp b/modules/lang/c++/c_helper.hpp new file mode 100644 index 0000000..550e55c --- /dev/null +++ b/modules/lang/c++/c_helper.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "c_common.hpp" + +namespace saw { +namespace impl { +struct lang_helper { + static error_or<void> append_string(std::string& buff, const std::string_view& str){ + try{ + buff += str; + }catch(const std::exception&){ + return make_error<err::out_of_memory>(); + } + + return make_void(); + } +}; +} +} |