#ifndef ARGPARSER_TYPE_H #define ARGPARSER_TYPE_H #include "defs.h" #include #include #include #include namespace argparser { class type { public: virtual ~type() = default; [[nodiscard]] std::string get_name() const { return name; } protected: explicit type(std::string name) : name(std::move(name)) {} std::string name; }; using type_handle = std::shared_ptr; template class type_impl : public type { public: virtual T parse(const char *begin, const char *end, const char *&parse_end, internal::parser_allow_undelimited allow_undelimited = internal::parser_allow_undelimited::None) = 0; protected: explicit type_impl(std::string name) : type(std::move(name)) {} }; template using type_handle_impl = std::shared_ptr>; }// namespace argparser #endif//ARGPARSER_TYPE_H