Actions
Feature #2238
closedIndentedStream
Start date:
Due date:
% Done:
100%
Estimated time:
1.00 h
Description
Move IndentedStream
to util/
from security/certificate.cpp
, so that it can be reused.
Updated by Alex Afanasyev about 10 years ago
- Blocks Task #2250: ndns-list-zone: Change output format for ID-CERTs added
Updated by Alex Afanasyev about 10 years ago
- Status changed from New to Code review
- Assignee set to Alex Afanasyev
- Target version set to v0.3
- % Done changed from 0 to 100
Updated by Junxiao Shi about 10 years ago
- Status changed from Code review to Closed
Updated by Junxiao Shi about 10 years ago
- Status changed from Closed to Feedback
indented-stream.cpp
is causing build errors on our Mac Mini.
OSX 10.9, clang-500.2.79, Boost 1.55
./waf configure --with-tests --debug --without-pch --without-osx-keychain
[ 66/181] Compiling src/util/indented-stream.cpp
In file included from ../src/util/indented-stream.cpp:27:
In file included from /opt/local/include/boost/algorithm/string/split.hpp:16:
/opt/local/include/boost/algorithm/string/iter_find.hpp:148:13: error: non-type template argument refers to function 'failed' that does not have linkage
BOOST_CONCEPT_ASSERT((
^~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/concept/assert.hpp:44:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/concept/detail/general.hpp:70:6: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
&::boost::concepts::requirement_<ModelFnPtr>::failed> \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/algorithm/string/split.hpp:146:20: note: in instantiation of function template specialization 'boost::algorithm::iter_split<std::__1::vector<boost::iterator_range<std::__1::__wrap_iter<const char *> >, std::__1::allocator<boost::iterator_range<std::__1::__wrap_iter<const char *> > > >, const std::__1::basic_string<char>, boost::algorithm::detail::token_finderF<<lambda at ../src/util/indented-stream.cpp:56:37> > >' requested here
return ::boost::algorithm::iter_split(
^
../src/util/indented-stream.cpp:56:3: note: in instantiation of function template specialization 'boost::algorithm::split<std::__1::vector<boost::iterator_range<std::__1::__wrap_iter<const char *> >, std::__1::allocator<boost::iterator_range<std::__1::__wrap_iter<const char *> > > >, const std::__1::basic_string<char>, <lambda at ../src/util/indented-stream.cpp:56:37> >' requested here
boost::split(splitOutput, output, [] (char ch) { return ch == '\n'; });
^
/opt/local/include/boost/concept/detail/general.hpp:46:17: note: non-type template argument refers to function here
static void failed() { ((Model*)0)->constraints(); }
^
1 error generated.
Waf: Leaving directory `/Users/shijunxiao/code/ndn-cxx/build'
Build failed
-> task in 'ndn-cxx' failed (exit status 1):
{task 4535795408: cxx indented-stream.cpp -> indented-stream.cpp.2.o}
['/usr/bin/clang++', '-std=c++0x', '-std=c++11', '-stdlib=libc++', '-pedantic', '-Wall', '-O0', '-g3', '-fcolor-diagnostics', '-Werror', '-Wno-error=unneeded-internal-declaration', '-fPIC', '-I/Users/shijunxiao/code/ndn-cxx/build', '-I/Users/shijunxiao/code/ndn-cxx', '-I/Users/shijunxiao/code/ndn-cxx/build/src', '-I/Users/shijunxiao/code/ndn-cxx/src', '-I/opt/local/include', '-DHAVE_SQLITE3=1', '../src/util/indented-stream.cpp', '-c', '-o', '/Users/shijunxiao/code/ndn-cxx/build/src/util/indented-stream.cpp.2.o']
Updated by Alex Afanasyev about 10 years ago
This seem to be some bug with clang:
- http://stackoverflow.com/questions/21937236/how-to-use-c11-lambda-as-boost-predicate
- http://stackoverflow.com/questions/20996127/c11-lambdas-doesnt-work-with-boostconcepts
I will update to use boost::is_any_of
instead of lambda.
Updated by Junxiao Shi about 10 years ago
Can we try #define BOOST_RESULT_OF_USE_DECLTYPE
?
Updated by Alex Afanasyev about 10 years ago
I have no way to test. Given the negative experience reported on stackoverflow, it is easier and less problematic use is_any_of functor. It has a little bit more overhead, but IndentedStream is seldomly used and can have any overhead.
Updated by Junxiao Shi about 10 years ago
- Status changed from Feedback to Closed
Actions