Код: Выделить всё
#include
// First header
struct S1IF
{
enum class Op1
{
Op1_NO,
Op1_YES
};
virtual bool DoSomething(Op1 what);
};
// Second header
struct S2
{
S1IF* GetS1() const;
};
// Calling implementation
bool SomeCode(S2* s2Inst)
{
return s2Inst->GetS1()->DoSomething(/*todo*/ s2Inst->GetS1() /*todo*/ ::Op1::Op1_NO );
}
Код: Выделить всё
using S1Ish = std::invoke_result_t;
typedef S1Ish::Op S1Op;
[build] C:/buildtools/mingw/llvm-mingw-20240606-ucrt-x86_64/include/c++/v1/__type_traits/invoke.h:459:1: error: no type named 'type' in 'std::invoke_result'
[build] 459 | using invoke_result_t = typename invoke_result::type;
Каков правильный/компактный способ доступа к этому перечислению косвенно? C ++ 17 - это в порядке. < /P>
Кроме того, мне также нужна совместимость C ++ 11. Это просто std :: result_of?
Подробнее здесь: https://stackoverflow.com/questions/797 ... sing-stdin