MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
iobject.hpp
1#ifndef MSTL_CORE_INTERFACE_IOBJECT_HPP__
2#define MSTL_CORE_INTERFACE_IOBJECT_HPP__
3#include "../interface/istringify.hpp"
5
6template <typename T>
7struct iobject : istringify<T> {
8public:
9 MSTL_NODISCARD static constexpr T parse(const string_view str) {
10 return T::parse(str);
11 }
12
13 MSTL_CONSTEXPR20 bool try_parse(const string_view str) noexcept {
14 T tmp;
15 try {
16 tmp = T::parse(str);
17 } catch (...) {
18 return false;
19 }
20 *this = _MSTL move(tmp);
21 return true;
22 }
23};
24
26#endif // MSTL_CORE_INTERFACE_IOBJECT_HPP__
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result)
移动范围元素