Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8704743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:11:09+00:00 2026-06-13T03:11:09+00:00

I don’t really understand what is going on. I’m using MSVC 2012, Boost 51.

  • 0

I don’t really understand what is going on. I’m using MSVC 2012, Boost 51. This code is expected to work fine, but it does not get compiled:

#include "stdafx.h"
#include <string>
#include <boost/variant/recursive_variant.hpp>

namespace NsSemSDK
{

struct STreeConstructionRuleRegexp {
    std::string m_strEntity;
};

struct STreeConstructionRuleString {
    std::string m_strEntity;
};

struct STreeConstructionRuleIdentifier {
    std::string m_strEntity;
};

typedef int STreeConstructionRuleNumber;

typedef boost::variant<STreeConstructionRuleRegexp, STreeConstructionRuleNumber> STreeConstructionRuleOperand; // STreeConstructionRuleString, STreeConstructionRuleIdentifier

}

std::ostream& operator<<(std::ostream& stream, const NsSemSDK::STreeConstructionRuleRegexp& val)
{
    return stream << '\'' << val.m_strEntity << '\'';
}

std::ostream& operator<<(std::ostream& stream, const NsSemSDK::STreeConstructionRuleString& val)
{
    return stream << '"' << val.m_strEntity << '"';
}

std::ostream& operator<<(std::ostream& stream, const NsSemSDK::STreeConstructionRuleIdentifier& val)
{
    return stream << val.m_strEntity;
}

using namespace NsSemSDK;

int _tmain(int argc, _TCHAR* argv[])
{
    STreeConstructionRuleNumber num = 1024;
    STreeConstructionRuleOperand operand = num;
    std::cout << operand << std::endl;
}

What I’m getting is:

1>------ Build started: Project: ConsoleApplication3, Configuration: Debug Win32 ------
1>  Source.cpp
1>c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\variant_io.hpp(64): error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const T0' (or there is no acceptable conversion)
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(695): could be 'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(742): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(780): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(827): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(953): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const signed char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(960): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,signed char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(967): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const unsigned char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(974): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,unsigned char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(984): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>,T>(std::basic_ostream<_Elem,_Traits> &&,const _Ty &)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              T=T0,
1>              _Ty=T0
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(1101): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const std::error_code &)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\blank.hpp(93): or       'std::basic_ostream<_Elem,_Traits> &boost::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const boost::blank &)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(201): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits> &(__cdecl *)(std::basic_ostream<_Elem,_Traits> &))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(207): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ios<_Elem,_Traits> &(__cdecl *)(std::basic_ios<_Elem,_Traits> &))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(214): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::ios_base &(__cdecl *)(std::ios_base &))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(221): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(241): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(short)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(275): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned short)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(295): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(int)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(320): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned int)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(340): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(360): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned long)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(381): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__int64)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(401): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(422): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(float)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(442): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(double)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(462): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(482): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\ostream(502): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_streambuf<_Elem,_Traits> *)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          while trying to match the argument list '(std::basic_ostream<_Elem,_Traits>, const T0)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(859) : see reference to function template instantiation 'void boost::detail::variant::printer<OStream>::operator ()<const T>(const T &) const' being compiled
1>          with
1>          [
1>              OStream=std::basic_ostream<char,std::char_traits<char>>,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(859) : see reference to function template instantiation 'void boost::detail::variant::printer<OStream>::operator ()<const T>(const T &) const' being compiled
1>          with
1>          [
1>              OStream=std::basic_ostream<char,std::char_traits<char>>,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\visitation_impl.hpp(130) : see reference to function template instantiation 'void boost::detail::variant::invoke_visitor<Visitor>::internal_visit<const T>(T &,int)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\visitation_impl.hpp(130) : see reference to function template instantiation 'void boost::detail::variant::invoke_visitor<Visitor>::internal_visit<const T>(T &,int)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\visitation_impl.hpp(173) : see reference to function template instantiation 'void boost::detail::variant::visitation_impl_invoke_impl<Visitor,VoidPtrCV,T>(int,Visitor &,VoidPtrCV,T *,boost::mpl::true_)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::invoke_visitor<boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>>,
1>              VoidPtrCV=const void *,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\visitation_impl.hpp(256) : see reference to function template instantiation 'void boost::detail::variant::visitation_impl_invoke<Visitor,VoidPtrCV,T0,NoBackupFlag>(int,Visitor &,VoidPtrCV,T *,NoBackupFlag,int)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::invoke_visitor<boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>>,
1>              VoidPtrCV=const void *,
1>              NoBackupFlag=boost::variant<NsSemSDK::STreeConstructionRuleRegexp,NsSemSDK::STreeConstructionRuleNumber>::has_fallback_type_,
1>              T=T0
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(1803) : see reference to function template instantiation 'void boost::detail::variant::visitation_impl<first_which,first_step,Visitor,VoidPtrCV,boost::variant<T0_,T1>::has_fallback_type_>(const int,const int,Visitor &,VoidPtrCV,boost::mpl::false_,NoBackupFlag,Which *,step0 *)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::invoke_visitor<boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>>,
1>              VoidPtrCV=const void *,
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              NoBackupFlag=boost::variant<NsSemSDK::STreeConstructionRuleRegexp,NsSemSDK::STreeConstructionRuleNumber>::has_fallback_type_,
1>              Which=first_which,
1>              step0=first_step
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(1825) : see reference to function template instantiation 'void boost::variant<T0_,T1>::internal_apply_visitor_impl<Visitor,const void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              Visitor=boost::detail::variant::invoke_visitor<boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>>,
1>              VoidPtrCV=const void *
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(1825) : see reference to function template instantiation 'void boost::variant<T0_,T1>::internal_apply_visitor_impl<Visitor,const void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              Visitor=boost::detail::variant::invoke_visitor<boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>>,
1>              VoidPtrCV=const void *
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(1847) : see reference to function template instantiation 'void boost::variant<T0_,T1>::internal_apply_visitor<boost::detail::variant::invoke_visitor<Visitor>>(boost::detail::variant::invoke_visitor<Visitor> &) const' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\variant.hpp(1847) : see reference to function template instantiation 'void boost::variant<T0_,T1>::internal_apply_visitor<boost::detail::variant::invoke_visitor<Visitor>>(boost::detail::variant::invoke_visitor<Visitor> &) const' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\variant_io.hpp(88) : see reference to function template instantiation 'void boost::variant<T0_,T1>::apply_visitor<boost::detail::variant::printer<OStream>>(Visitor &) const' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              OStream=std::basic_ostream<char,std::char_traits<char>>,
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\boost\variant\detail\variant_io.hpp(88) : see reference to function template instantiation 'void boost::variant<T0_,T1>::apply_visitor<boost::detail::variant::printer<OStream>>(Visitor &) const' being compiled
1>          with
1>          [
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber,
1>              OStream=std::basic_ostream<char,std::char_traits<char>>,
1>              Visitor=boost::detail::variant::printer<std::basic_ostream<char,std::char_traits<char>>>
1>          ]
1>          c:\users\vsevolod.sauta\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\source.cpp(47) : see reference to function template instantiation 'std::basic_ostream<_Elem,_Traits> &boost::operator <<<char,std::char_traits<char>,NsSemSDK::STreeConstructionRuleRegexp,NsSemSDK::STreeConstructionRuleNumber,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>(std::basic_ostream<_Elem,_Traits> &,const boost::variant<T0_,T1> &)' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              T0_=NsSemSDK::STreeConstructionRuleRegexp,
1>              T1=NsSemSDK::STreeConstructionRuleNumber
1>          ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I don’t know what is type T0 and why is it casted to T0. I expect it to be something internal to boost::variant. But still I don’t have any clue, why I get there: operators “<<” for all types in variant are defined.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:11:11+00:00Added an answer on June 13, 2026 at 3:11 am

    You should define the operator<< inside the namespace NsSemSDK, so that these functions can be found by ADL. (Example.)

    #include <string>
    #include <iostream>
    #include <boost/variant.hpp>
    
    namespace NsSemSDK
    {
    
    struct STreeConstructionRuleRegexp {
        std::string m_strEntity;
    };
    
    struct STreeConstructionRuleString {
        std::string m_strEntity;
    };
    
    struct STreeConstructionRuleIdentifier {
        std::string m_strEntity;
    };
    
    typedef int STreeConstructionRuleNumber;
    
    std::ostream& operator<<(std::ostream& stream,
                             const STreeConstructionRuleRegexp& val)
    {
        return stream << '\'' << val.m_strEntity << '\'';
    }
    
    std::ostream& operator<<(std::ostream& stream,
                             const STreeConstructionRuleString& val)
    {
        return stream << '"' << val.m_strEntity << '"';
    }
    
    std::ostream& operator<<(std::ostream& stream,
                             const STreeConstructionRuleIdentifier& val)
    {
        return stream << val.m_strEntity;
    }
    
    typedef boost::variant<
        STreeConstructionRuleRegexp,
        STreeConstructionRuleNumber
    > STreeConstructionRuleOperand;
    
    // STreeConstructionRuleString, STreeConstructionRuleIdentifier
    }
    
    using namespace NsSemSDK;
    
    int main()
    {
        STreeConstructionRuleNumber num = 1024;
        STreeConstructionRuleOperand operand = num;
        std::cout << operand << std::endl;
    }
    

    Outputs

    1024

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know why, but this code worked for me a month ago... maybe
Don't know why this is happening, but after submitting a form via JS (using
Don't understand this simple code: def main(): print (This program illustrates a chaotic function)
don't know better title for this, but here's my code. I have class user
Don't know how to frase this but I found this code wich works as
Don't really know how to formulate the title, but it should be pretty obvious
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't know why this doesn't work. I can't do implicit animation for a newly
Don't know a whole lot about streams. Why does the first version work using
Don't know if this is the right place to ask this, but I will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.