summaryrefslogtreecommitdiff
path: root/modules/lang/c++/c_helper.hpp
blob: 550e55cf52576d91556dcbabc14613896b724db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();
	}
};
}
}