[Boost-bugs] [Boost C++ Libraries] #9329: Compilation fixes for Sun CC and its ancient standard library

Subject: [Boost-bugs] [Boost C++ Libraries] #9329: Compilation fixes for Sun CC and its ancient standard library
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-30 23:23:15


#9329: Compilation fixes for Sun CC and its ancient standard library
------------------------------+-----------------------------
 Reporter: vz-boost@… | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: program_options
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------------
 This patch avoids the following errors when compiling the library using
 Sun CC (Sun C++ 5.10 SunOS_i386 2009/06/03):
 {{{
 "libs/program_options/src/options_description.cpp", line 422: Error,
 nomatchoverin: Could not find a match for std::count<std::_InputIterator,
 std::_T, std::_Size>(char*, char*, char) needed
 in::format_paragraph(std::ostream &, std::string, unsigned, unsigned).
 "libs/program_options/src/options_description.cpp", line
 "libs/program_options/src/options_description.cpp", line 483: Error,
 toofewtargs: Too few arguments for template std::reverse_iterator.
 "/opt/sunstudio12.1/prod/include/CC/Cstd/rw/iterator", line 426: Error,
 nofunctmpl: "friend" declaration is incompatible with function template.
 "libs/program_options/src/options_description.cpp", line 483: Where,
 temwhilespec: While specializing "std::reverse_iterator<const char*>".
 "libs/program_options/src/options_description.cpp", line 483: Where,
 temspecend: Specialized in non-template code.
 "libs/program_options/src/options_description.cpp", line 484: Error,
 toofewtargs: Too few arguments for template std::reverse_iterator.
 472: Error, nomatchoverin: Could not find a match for
 std::distance<std::_ForwardIterator, std::_Distance>(const char*, const
 char*const) needed in::format_paragraph(std::ostream &, std::string,
 unsigned, unsigned).
 "libs/program_options/src/value_semantic.cpp", line 371: Error,
 nomatchoverin: Could not find a match for
 std::vector<std::string>::vector(__rwstd::__rb_tree<std::string,
 std::string, __rwstd::__ident<std::string, std::string>,
 std::less<std::string>, std::allocator<std::string>>::const_iterator,
 __rwstd::__rb_tree<std::string, std::string, __rwstd::__ident<std::string,
 std::string>, std::less<std::string>,
 std::allocator<std::string>>::const_iterator) needed in
 boost::program_options::ambiguous_option::substitute_placeholders(const
 std::string &) const.
 }}}

 I don't really understand neither of them, unfortunately: looking at the
 standard library headers both the calls to `count()` and `distance()`
 should compile. OTOH neither of them is really necessary so I hope this
 patch can be applied nevertheless. With `reverse_iterator` it's more
 mysterious but, again, IMHO its use in the original code is not really
 needed, so I've just replaced it with `rfind()`.

 The last error is clear: this compiler standard library doesn't provide
 template ctor of `std::vector` from an iterator pair, so an alternative
 method of constructing it must be used. This does make the code less
 concise and elegant, but unfortunately I don't see any other way to make
 it work in this case.

 TIA!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9329>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC