#include "parser_state.h"
#include "stg/common.h"
-#include "stg/optional.h"
#include <string>
+#include <optional>
#include <cassert>
class PARAM_ACTION : public ACTION
{
public:
- PARAM_ACTION(STG::Optional<T> & param,
+ PARAM_ACTION(std::optional<T> & param,
const T & defaultValue,
const std::string & paramDescription)
: m_param(param),
m_description(paramDescription),
m_hasDefault(true)
{}
- explicit PARAM_ACTION(STG::Optional<T> & param)
+ explicit PARAM_ACTION(std::optional<T> & param)
: m_param(param),
m_hasDefault(false)
{}
- PARAM_ACTION(STG::Optional<T> & param,
+ PARAM_ACTION(std::optional<T> & param,
const std::string & paramDescription)
: m_param(param),
m_description(paramDescription),
void ParseValue(const std::string & value) override;
private:
- STG::Optional<T> & m_param;
+ std::optional<T> & m_param;
T m_defaltValue;
std::string m_description;
bool m_hasDefault;
template <typename T>
inline
-std::unique_ptr<ACTION> MakeParamAction(STG::Optional<T> & param,
+std::unique_ptr<ACTION> MakeParamAction(std::optional<T> & param,
const T & defaultValue,
const std::string & paramDescription)
{
template <typename T>
inline
-std::unique_ptr<ACTION> MakeParamAction(STG::Optional<T> & param)
+std::unique_ptr<ACTION> MakeParamAction(std::optional<T> & param)
{
return std::make_unique<PARAM_ACTION<T>>(param);
}
template <typename T>
inline
-std::unique_ptr<ACTION> MakeParamAction(STG::Optional<T> & param,
+std::unique_ptr<ACTION> MakeParamAction(std::optional<T> & param,
const std::string & paramDescription)
{
return std::make_unique<PARAM_ACTION<T>>(param, paramDescription);