can compile now

This commit is contained in:
2023-08-27 16:45:07 +08:00
parent 168d76939b
commit c8f18bce0c
6 changed files with 262 additions and 90 deletions

View File

@ -148,12 +148,12 @@ namespace Unvirt::CmdHelper {
friend class Literal;
friend class AbstractArgument;
public:
using vType = int32_t;
using vType = size_t;
Choice(const char* argname, const std::initializer_list<std::string>& vocabulary);
virtual ~Choice();
LIBCMO_DISABLE_COPY_MOVE(Choice);
size_t* GetIndex();
vType* GetIndex();
public:
virtual NodeType GetNodeType() override;
@ -260,9 +260,9 @@ namespace Unvirt::CmdHelper {
AbstractNode* node = finder->second;
switch (node->GetNodeType()) {
case NodeType::Argument:
return dynamic_cast<AbstractArgument*>(node)->GetData<_Ty*>();
return reinterpret_cast<_Ty*>(dynamic_cast<AbstractArgument*>(node)->GetData<_Ty*>());
case NodeType::Choice:
return dynamic_cast<Choice*>(node)->GetIndex();
return reinterpret_cast<_Ty*>(dynamic_cast<Choice*>(node)->GetIndex());
case NodeType::Literal:
default:
throw std::runtime_error("No such argument type.");