mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
vcmi: use std::variant
This commit is contained in:
@@ -213,15 +213,15 @@ namespace VERMInterpreter
|
||||
{};
|
||||
|
||||
|
||||
typedef boost::variant<char, double, int, std::string> TLiteral;
|
||||
typedef std::variant<char, double, int, std::string> TLiteral;
|
||||
|
||||
typedef boost::variant<VNIL, boost::recursive_wrapper<VNode>, VSymbol, TLiteral, ERM::Tcommand> VOption; //options in v-expression, VNIl should be the default
|
||||
typedef std::variant<VNIL, boost::recursive_wrapper<VNode>, VSymbol, TLiteral, ERM::Tcommand> VOption; //options in v-expression, VNIl should be the default
|
||||
|
||||
template<typename T, typename SecType>
|
||||
T& getAs(SecType & opt)
|
||||
{
|
||||
if(opt.type() == typeid(T))
|
||||
return boost::get<T>(opt);
|
||||
return std::get<T>(opt);
|
||||
else
|
||||
throw EVermScriptExecError("Wrong type!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user