Project

General

Profile

Actions

Feature #2238

closed

IndentedStream

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
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.


Related issues 1 (0 open1 closed)

Blocks ndns - Task #2250: ndns-list-zone: Change output format for ID-CERTsClosedJiewen Tan11/30/2014

Actions
Actions #1

Updated by Alex Afanasyev about 10 years ago

  • Blocks Task #2250: ndns-list-zone: Change output format for ID-CERTs added
Actions #2

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
Actions #3

Updated by Junxiao Shi about 10 years ago

  • Status changed from Code review to Closed
Actions #4

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']
Actions #6

Updated by Junxiao Shi about 10 years ago

Can we try #define BOOST_RESULT_OF_USE_DECLTYPE?

Actions #7

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.

Actions #8

Updated by Junxiao Shi about 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF