Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created January 26, 2014 23:54
Show Gist options
  • Save springmeyer/8641097 to your computer and use it in GitHub Desktop.
Save springmeyer/8641097 to your computer and use it in GitHub Desktop.
boost karma confix compile error
$ clang++ -o t testcase.cpp -I/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1
In file included from t.cpp:2:
In file included from /Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/repository/include/karma_confix.hpp:16:
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/repository/home/karma/directive/confix.hpp:49:11: error: no member named 'confix' in namespace
'boost::spirit::repository'; did you mean 'tag::confix'?
using repository::confix;
^~~~~~~~~~~~~~~~~~
tag::confix
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/repository/home/support/confix.hpp:18:45: note: 'tag::confix' declared here
BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX(( confix, confix_type ))
^
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/home/support/terminal.hpp:650:46: note: expanded from macro 'BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX'
BOOST_PP_CAT(BOOST_SPIRIT_TERMINAL_X seq, 0)) \
^
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/home/support/terminal.hpp:576:41: note: expanded from macro 'BOOST_SPIRIT_TERMINAL_X'
#define BOOST_SPIRIT_TERMINAL_X(x, y) ((x, y)) BOOST_SPIRIT_TERMINAL_Y
^
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/preprocessor/cat.hpp:22:47: note: expanded from macro 'BOOST_PP_CAT'
# define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
^
note: (skipping 17 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/preprocessor/tuple/elem.hpp:48:42: note: expanded from macro 'BOOST_PP_TUPLE_ELEM_I'
# define BOOST_PP_TUPLE_ELEM_I(x) x
^
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/preprocessor/tuple/elem.hpp:114:345: note: expanded from macro 'BOOST_PP_TUPLE_ELEM_0'
...e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63) e0
^
/Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64/include/boost/spirit/home/support/terminal.hpp:631:28: note: expanded from macro 'BOOST_SPIRIT_TERMINAL_NAME_EX'
namespace tag { struct name { BOOST_SPIRIT_IS_TAG() }; } \
^
1 error generated.
#include <boost/spirit/include/karma.hpp>
#include <boost/spirit/repository/include/karma_confix.hpp>
template <typename OutputIterator>
bool generate_numbers(OutputIterator& sink, double val)
{
boost::spirit::karma::double_type double_;
boost::spirit::karma::ascii::space_type space;
boost::spirit::repository::confix_type confix;
bool r = boost::spirit::karma::generate_delimited(
sink,
confix('"', '"')[double_],
space,
val
);
return r;
}
int main() {
std::string str;
std::back_insert_iterator<std::string> sink(str);
std::clog << generate_numbers(sink, 2.0) << "\n";
std::clog << str << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment