Why can't I visit this custom type with boost::variant?

前端 未结 1 960
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-14 16:48

The following code:

#include 
#include 
#include 

struct A
{
    A()
    {
    }
    ~A() throw()
            


        
相关标签:
1条回答
  • 2021-01-14 17:43
    message_t a(A());
    

    Has the most-vexing-parse problem: declares a function rather than creates a variable. Many ways to resolve, e.g. message_t a = A();

    0 讨论(0)
提交回复
热议问题