Containing X3 rules in user namespaces

Michael Powell <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <CAMEoF_HY_0iWssMuTHCKZLqgVVexgaBOacJa1zbx2m_j1wV7=A@mail.gmail.com>
Hello,

Is it possible to contain rules in user namespaces? i.e.

namespace Kmsg {

    namespace IPv4 {

        using namespace boost::spirit;
        using namespace boost::spirit::x3;


        x3::rule<class octet, std::uint8_t> const octet = "octet";

        auto const octet_def = digit
            | (char_('1', '9') >> digit[repeat(1, 2)])
            | (char_('2') >> char_('0', '4') >> digit)
            | ("25" >> char_('0', '5'))
            ;
    }
}

BOOST_SPIRIT_DEFINE(Kmsg::IPv4::octet);

Untested at the moment. Just wanted to propose the question for now.

Cheers,

Michael Powell

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.