我有自己的智能指针实现,现在我试图解决通过其指针调用成员函数的问题.我没有提供任何类似get()的函数(实际上,我提供了一个operator->,但我不想将它用于此目的).
我的问题是:签名和返回类型应该是什么operator->*样的?
我写了这个代码示例并期望它打印OPERATION( OPERATOR(aaa) ID(bbb) )但我只是OPERATION ( OPERATOR(aaa) )改为.这两个result2和it1 == it2是真实的.为什么操作数不被解析?
#include "stdafx.h"
#include <boost/serialization/strong_typedef.hpp>
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/phoenix1.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/support.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/variant/recursive_variant.hpp>
#include <iostream>
#include <string>
namespace NsSemSDK
{
struct STreeConstructionRuleRegexp {
std::string m_strEntity;
};
struct STreeConstructionRuleString {
std::string m_strEntity;
};
struct STreeConstructionRuleIdentifier {
std::string m_strEntity;
};
typedef int STreeConstructionRuleNumber;
typedef std::string STreeConstructionRuleOperation;
typedef boost::variant<STreeConstructionRuleRegexp, STreeConstructionRuleNumber, STreeConstructionRuleString, STreeConstructionRuleIdentifier> STreeConstructionRuleOperand; …Run Code Online (Sandbox Code Playgroud)