I'm not sure what I'm doing wrong here:
vector<string> names;
...
string lh = "localhost";
vector<string>::iterator it = std::find(names.begin(), names.end(), lh);
if(it != names.end())
names.push_back(lh);
The line with find results in:
../source/ac-pki-4.cpp: In function ‘std::vector<std::basic_string<char> > GetServerAltNames()’:
../source/ac-pki-4.cpp:757:76: error: no matching function for call to ‘find(std::vector<std::basic_string<char> >::iterator, std::vector<std::basic_string<char> >::iterator, std::basic_string<char>&)’
../source/ac-pki-4.cpp:757:76: note: candidate is:
In file included from /usr/include/c++/4.7/bits/locale_facets.h:50:0,
from /usr/include/c++/4.7/bits/basic_ios.h:39,
from /usr/include/c++/4.7/ios:45,
from /usr/include/c++/4.7/ostream:40,
from /usr/include/c++/4.7/iostream:40,
from /home/jwalton/ac/include/ac-common.h:33,
from ../source/ac-pki-4.cpp:1:
/usr/include/c++/4.7/bits/streambuf_iterator.h:371:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT2, std::char_traits<_CharT> > >::__type std::find(std::istreambuf_iterator<_CharT2, std::char_traits<_CharT> >, std::istreambuf_iterator<_CharT2, std::char_traits<_CharT> >, const _CharT2&)
/usr/include/c++/4.7/bits/streambuf_iterator.h:371:5: note: template argument deduction/substitution failed:
../source/ac-pki-4.cpp:757:76: note: ‘__gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >’ is not derived from ‘std::istreambuf_iterator<_CharT2, std::char_traits<_CharT> >’
make: *** [source/ac-pki-4.o] Error 1
I also tried the following with no joy:
std::basic_string<char> lh = "localhost";
And I tried a const_iterator with no joy.
Below is a screen capture of what I am seeing under Eclipse.
Any ideas what I'm doing wrong? (And why is a istreambuf_iterator being used in this case?).
<iostream> seems to be including some headers that have an overload of std::find that is different from the one that resides in <algorithm>. In order to use the correct one, you must include <algorithm>. Uncomment the include line on this live example to see what I mean (and <iostream> too for further investigation.) See libstdc++ docs.
Related
Difference between sort(begin(ans), end(ans)) vs sort(begin(ans), end(ans), std::greater<std::vector<std::vector<int> > >())
as sort(begin(ans), end(ans)) works perfectly as expected where as specifing the greater doesn't works.
vector<int> S = {12,13, 34, 9,10};
vector<vector<int> >ans;
vector<int> currSet;
subset(0, S, currSet, ans);
sort(begin(ans), end(ans), std::greater<std::vector<std::vector<int> > >());
cout << ans.size();
}
give error
In file included from subset.cpp:1:
In file included from /usr/local/include/bits/stdc++.h:52:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/complex:247:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/sstream:174:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ostream:138:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ios:216:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__locale:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:505:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string_view:176:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__string:57:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:3832:17: error: no
matching function for call to object of type
'std::__1::greater<std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >,
std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > > >'
if (__comp(*--__last, *__first))
^~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:4018:5: note: in
instantiation of function template specialization
'std::__1::__sort<std::__1::greater<std::__1::vector<std::__1::vector<int,
std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int,
std::__1::allocator<int> > > > > &, std::__1::vector<int, std::__1::allocator<int> >
*>' requested here
__sort<_Comp_ref>(__first, __last, __comp);
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:4052:12: note: in
instantiation of function template specialization
'std::__1::sort<std::__1::vector<int, std::__1::allocator<int> > *,
std::__1::greater<std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >,
std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > > > &>'
requested here
_VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp);
^
subset.cpp:33:3: note: in instantiation of function template specialization
'std::__1::sort<std::__1::vector<int, std::__1::allocator<int> >,
std::__1::greater<std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >,
std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > > > >'
requested here
sort(all(ans), greater<vector<vector<int> > >());
^
std::greater<std::vector<std::vector<int> > > is for comparing objects of type std::vector<std::vector<int> >. But the vector ans does not contain objects of that type. It contains objects of type std::vector<int>. Thus, the comparator that you need is std::greater<std::vector<int>>. Or, you could simply use std::greater<> which is simpler to read, write and less likely to result in a bug.
The template prameter for std::greater needs to be the element type that the iterators point to. Since the iterator for of std::vector<std::vector<int>> has a value_type of std::vector<int> (that's the type of the of the elements in ans) that is what you need. That gives you
sort(begin(ans), end(ans), std::greater<std::vector<int> >());
as what you need.
Also note that a space is no longer required for the closing > in a template parameter list. You can use
sort(begin(ans), end(ans), std::greater<std::vector<int>>());
and that will compile in a C++11+ compliant compiler.
I have the following header file in order to use boost geometry types:
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
#include <boost/geometry/geometries/register/point.hpp>
using namespace boost::geometry;
using namespace detail::assign;
typedef model::d2::point_xy<double> point_xy;
typedef model::polygon<point_xy> polygon;
typedef model::multi_polygon<polygon> multi_polygon;
typedef model::box<point_xy> box;
When compiling a file that attempts to use these types, I get a massive compiler error:
In file included from src/geometry.cpp:11:
In file included from src/../include/geometry.hpp:9:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:26:
In file included from /usr/local/include/boost/geometry/core/coordinate_dimension.hpp:23:
/usr/local/include/boost/geometry/core/point_type.hpp:45:5: error: no matching function for call to 'assertion_failed'
BOOST_MPL_ASSERT_MSG
^~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:454:51: note: expanded from macro 'BOOST_MPL_ASSERT_MSG'
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
^
/usr/local/include/boost/mpl/assert.hpp:440:9: note: expanded from macro '\
BOOST_MPL_ASSERT_MSG_IMPL'
boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
# define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
^~~~
/usr/local/include/boost/geometry/core/point_type.hpp:65:30: note: in instantiation of template class
'boost::geometry::traits::point_type<std::__1::vector<float, std::__1::allocator<float> > >' requested here
typename traits::point_type<Geometry>::type
^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:58:22: note: in instantiation of template class 'boost::geometry::core_dispatch::point_type<void,
std::__1::vector<float, std::__1::allocator<float> > >' requested here
typedef typename point_type<GeometryTag, Geometry>::type point_type;
^
/usr/local/include/boost/geometry/core/coordinate_type.hpp:88:37: note: in instantiation of template class 'boost::geometry::core_dispatch::coordinate_type<void,
std::__1::vector<float, std::__1::allocator<float> > >' requested here
typedef typename core_dispatch::coordinate_type
^
/usr/local/include/boost/geometry/core/access.hpp:269:17: note: in instantiation of template class 'boost::geometry::coordinate_type<std::__1::vector<float,
std::__1::allocator<float> > >' requested here
inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
^
/usr/local/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp:42:74: note: while substituting deduced template arguments into function template
'get' [with Dimension = 0, Geometry = std::__1::vector<float, std::__1::allocator<float> >]
set<Dimension>(destination, boost::numeric_cast<coordinate_type>(get<Dimension>(source)));
^
/usr/local/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp:58:76: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0
to see all)
point_to_point<Source, Destination, 0, dimension<Destination>::value>::apply(source, destination);
^
/usr/local/include/boost/geometry/algorithms/append.hpp:129:45: note: in instantiation of member function
'boost::geometry::detail::append::append_range<boost::geometry::model::ring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>,
true, true, vector, allocator>, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float,
std::__1::allocator<float> > > > >::apply' requested here
append_range<ring_type, Range>::apply(
^
/usr/local/include/boost/geometry/algorithms/append.hpp:296:51: note: in instantiation of member function
'boost::geometry::detail::append::range_to_polygon<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double,
boost::geometry::cs::cartesian>, true, true, std::vector, std::vector, std::allocator, std::allocator>, std::__1::vector<std::__1::vector<float,
std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > >::apply' requested here
dispatch::append<Geometry, RangeOrPoint>::apply(geometry,
^
/usr/local/include/boost/geometry/algorithms/append.hpp:371:22: note: in instantiation of function template specialization
'boost::geometry::resolve_variant::append<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>,
true, true, std::vector, std::vector, std::allocator, std::allocator> >::apply<std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >,
std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > >' requested here
::apply(geometry, range_or_point, ring_index, multi_index);
^
/usr/local/include/boost/geometry/algorithms/assign.hpp:75:15: note: in instantiation of function template specialization
'boost::geometry::append<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, true, true,
std::vector, std::vector, std::allocator, std::allocator>, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >,
std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > >' requested here
geometry::append(geometry, range, -1, 0);
^
src/geometry.cpp:213:5: note: in instantiation of function template specialization
'boost::geometry::assign_points<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, true, true,
std::vector, std::vector, std::allocator, std::allocator>, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >,
std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > >' requested here
assign_points(poly, shape.border);
^
/usr/local/include/boost/mpl/assert.hpp:83:5: note: candidate function not viable: no known conversion from 'boost::mpl::failed
************(boost::geometry::traits::point_type<std::__1::vector<float, std::__1::allocator<float> >
>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::************)(types<std::__1::vector<float, std::__1::allocator<float> > >)' to 'typename assert<false>::type'
(aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
^
In file included from src/geometry.cpp:11:
In file included from src/../include/geometry.hpp:9:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:28:
/usr/local/include/boost/geometry/core/coordinate_type.hpp:43:5: error: no matching function for call to 'assertion_failed'
BOOST_MPL_ASSERT_MSG
^~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:454:51: note: expanded from macro 'BOOST_MPL_ASSERT_MSG'
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
I have seen this post in which they did not register tuples - however, I am not using tuples or any special kind of point - I am just attempting to use the built in geometry types. Why is this error still occurring?
As you can see, the code posted is not a problem per se: Live On Coliru.
So,there must be something else interfering. I have three hunches:
It's somewhere else in your code that you didn't post. The cause of the error is in ../src/geometry.cpp (not Boost library):
assign_points(poly, shape.border);
That gives you good ideas on how to reduce to a MCVE.
You have preprocessor issues. Try pre-processing your sources and see whether any of the code appearing in the error messages looks suspect.
A classical example of this would be if some other included header defines tokens like #define min(a,b) ... or other commonly used words.
Side note: this is about code-hygiene. A related note is the appearance of using namespace in your shown code snippet. This just begs namespace collisions or unintended effects.
Slightly related: the source of the interference could have to do with pre-compiled headers. Try disabling those or making sure you know what is in the PCH header (especially on MSVC (commonly using stdafx.h) precompiled headers have some potentially surprising effects)
UPDATE
I think I spotted it: the offending code at src/geometry.cpp:213:5 calls:
assign_points(poly, shape.border);
With the types: poly is
boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, true, true, std::vector, std::vector, std::allocator, std::allocator>,
That's the polygon typedef you show above. But shape.border is:
std::__1::vector<std::__1::vector<float, std::__1::allocator<float>>, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float>>>>>
That's just vector<std::vector<float> >. That's not a supported Geometry.
I have a bit of code (which I didn't write, but am trying to compile) -- iostream_combo.cc--, and doing so gives me the following error:
./moses/moses/comboreduct/combo/iostream_combo.cc: In function ‘std::__cxx11::string opencog::combo::l2ph(const string&, const std::vector<std::__cxx11::basic_string<char> >&)’:
./moses/moses/comboreduct/combo/iostream_combo.cc:543:64: error: call of overloaded ‘distance(std::vector<std::__cxx11::basic_string<char> >::const_iterator, __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >&)’ is ambiguous
arity_t idx = distance(labels.begin(), found_it) + 1;
^ In file included from /usr/include/c++/8/bits/stl_algobase.h:66,
from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from ./moses/moses/comboreduct/combo/iostream_combo.h:28,
from ./moses/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/include/c++/8/bits/stl_iterator_base_funcs.h:138:5: note: candidate: ‘typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename std::iterator_traits<_Iterator>::difference_type = long int]’
distance(_InputIterator __first, _InputIterator __last)
^~~~~~~~ In file included from /usr/local/include/boost/range/distance.hpp:18,
from /usr/local/include/boost/range/functions.hpp:21,
from /usr/local/include/boost/range/iterator_range_core.hpp:38,
from /usr/local/include/boost/lexical_cast.hpp:30,
from ./moses/moses/comboreduct/combo/iostream_combo.h:30,
from ./moses/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate: ‘constexpr typename boost::iterators::iterator_difference<Iterator>::type boost::iterators::distance_adl_barrier::distance(SinglePassIterator, SinglePassIterator) [with SinglePassIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename boost::iterators::iterator_difference<Iterator>::type = long int]’
distance(SinglePassIterator first, SinglePassIterator last)
^~~~~~~~
I'm using Ubuntu 16.04 x64, Boost 1.68 and gcc 8.2. So, the steps to reproduce the problem would be as follows:
On Ubuntu 16.04
install gcc-8
Use it to build boost 1.68 from source
Git clone the moses repository sand follow the instructions from there: basically 1) git clone and build cogutil; 2) try to make moses:
cd build, cmake .., make.
I understand C++ enough (I think) that I can see that the call to std::distance is overloaded. What I don't see is the way to disambiguate it, although I guess it must include some re-writing of found_it or some explicit castings instead of auto.
The calls are like:
arity_t idx = distance(labels.begin(), found_it) + 1;
This means that distance is found via ADL and hence all associated namespaces are considered. This might prove problematic if e.g. there are two namespaces providing an equally applicable overload for distance:
Live On Coliru
#include <iterator>
#include <vector>
namespace OyVeh {
struct X { };
template <typename It>
size_t distance(It, It) { return 42; } // just to throw in a wrench
}
int main() {
std::vector<OyVeh::X> v{3};
auto f = v.begin();
auto l = v.end();
// now f and l have both `::std` and `::OyVeh` as associated namespaces. The following is ambiguous:
return distance(f, l);
}
There are roughly 2 ways to fix it:
remove the ambigious distance declaration from the associated namespace (this might not be possible if e.g. the ones competing are std::distance and boost::distance)
edit the calls to remove the reliance on ADL (e.g. qualify them like std::distance(...) or parenthesize them (distance)(...))
Showing the workarounds:
Live On Coliru
{
using OyVeh::distance;
return (distance)(f, l); // parentheses suppress ADL
}
return std::distance(f, l); // also works, obviously
return OyVeh::distance(f, l); // but beware the meaning might change
I'm trying to use boost::to_lower_copy and std::transform to lower-case a bunch of strings. As below, Variant 1, using a lamdba works; Variant 2 also works demonstrating that that's the right template-overload the compiler picks. But the lambda is silly – all it does is forward the single argument along to boost::to_lower_copy. But Variant 3, using the function template directly doesn't compile, even if I instantiate it. What am I missing?
I have clang version 3.3 (tags/RELEASE_33/rc3), using libstdc++-4.8.1-1.fc19.i686 and boost-1.53.0-14.fc19.i686.
vector<string> strings = {"Foo", "Bar"};
vector<string> lower_cased_strings;
transform(
strings.begin(),
strings.end(),
inserter(lower_cased_strings, lower_cased_strings.end()),
// Variant 1
// [](const string &word) {
// return boost::to_lower_copy(word);
// }
// Variant 2
// [](const string &word) {
// return boost::to_lower_copy<string>(word);
// }
// Variant 3
boost::to_lower_copy<string>
);
> clang++ -std=c++11 lowercase.cxx
In file included from lowercase.cxx:3:
In file included from /usr/include/boost/algorithm/string.hpp:18:
In file included from /usr/include/boost/algorithm/string/std_containers_traits.hpp:23:
In file included from /usr/include/boost/algorithm/string/std/slist_traits.hpp:16:
In file included from /usr/lib/gcc/i686-redhat-linux/4.8.1/../../../../include/c++/4.8.1/ext/slist:47:
In file included from /usr/lib/gcc/i686-redhat-linux/4.8.1/../../../../include/c++/4.8.1/algorithm:62:
/usr/lib/gcc/i686-redhat-linux/4.8.1/../../../../include/c++/4.8.1/bits/stl_algo.h:4949:33: error: too few arguments to function call, expected 2, have 1
*__result = __unary_op(*__first);
~~~~~~~~~~ ^
lowercase.cxx:11:5: note: in instantiation of function template specialization 'std::transform<__gnu_cxx::__normal_iterator<std::basic_string<char> *, std::vector<std::basic_string<char>,
std::allocator<std::basic_string<char> > > >, std::insert_iterator<std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > >, std::basic_string<char> (*)(const std::basic_string<char>
&, const std::locale &)>' requested here
transform(
^
Default function arguments.
boost::to_lower_copy has a 3 argument and 2 argument version. The 2 argument version, which you are instantiating, has a default argument. So when called directly, you do not need to provide it, it is provided implicitly.
The function pointer to to_lower_copy does not, however, package the fact there is a default argument.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Deciphering C++ template error messages
everytime I get this kind of template error message:
In file included from /usr/include/boost/mpl/set/aux_/iterator.hpp:19:0,
from /usr/include/boost/mpl/set/aux_/begin_end_impl.hpp:19,
from /usr/include/boost/mpl/set/set0.hpp:29,
from /usr/include/boost/parameter/aux_/set.hpp:13,
from /usr/include/boost/parameter/parameters.hpp:48,
from /usr/include/boost/accumulators/framework/accumulator_set.hpp:19,
from /usr/include/boost/accumulators/accumulators.hpp:12,
from src/SimMany.cpp:4:
/usr/include/boost/mpl/has_key.hpp: In instantiation of ‘boost::mpl::has_key<mpl_::arg<1>, mpl_::ar
g<2> >’:
/usr/include/boost/mpl/if.hpp:67:11: instantiated from ‘boost::mpl::if_<boost::mpl::has_key<mpl_:
:arg<1>, mpl_::arg<2> >, boost::mpl::identity<mpl_::arg<1> >, boost::mpl::insert<mpl_::arg<1>, boos
t::mpl::pair<mpl_::arg<2>, mpl_::arg<2> >, mpl_::na> >’
/usr/include/boost/mpl/eval_if.hpp:37:41: instantiated from ‘boost::mpl::eval_if<boost::mpl::has_
key<mpl_::arg<1>, mpl_::arg<2> >, boost::mpl::identity<mpl_::arg<1> >, boost::mpl::insert<mpl_::arg
<1>, boost::mpl::pair<mpl_::arg<2>, mpl_::arg<2> >, mpl_::na> >’
/usr/include/boost/accumulators/framework/depends_on.hpp:330:9: instantiated from ‘boost::accumul
ators::detail::insert_feature<mpl_::arg<1>, mpl_::arg<2> >’
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85:5: instantiated from ‘const in
t boost::mpl::aux::template_arity_impl<boost::accumulators::detail::insert_feature<mpl_::arg<1>, mp
l_::arg<2> >, 1>::value’
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:93:5: instantiated from ‘const in
t boost::mpl::aux::template_arity<boost::accumulators::detail::insert_feature<mpl_::arg<1>, mpl_::a
rg<2> > >::value’
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98:30: [ skipping 2 instantiation
contexts ]
/usr/include/boost/mpl/aux_/preprocessed/gcc/apply.hpp:73:1: instantiated from ‘boost::mpl::apply
2<boost::mpl::if_<boost::mpl::is_sequence<mpl_::arg<2> >, boost::accumulators::detail::insert_seque
nce<mpl_::arg<1>, mpl_::arg<2>, void>, boost::accumulators::detail::insert_feature<mpl_::arg<1>, mp
l_::arg<2> > >, boost::mpl::map0<>, boost::accumulators::tag::mean>’
/usr/include/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp:166:1: instantiated from ‘boost::mpl::
aux::fold_impl<-0x00000000000000001, boost::mpl::aux::transform_iter<boost::mpl::v_iter<boost::accu
mulators::stats<boost::accumulators::tag::mean, boost::accumulators::tag::variance(boost::accumulat
ors::lazy)>, 0l>, boost::mpl::v_iter<boost::accumulators::stats<boost::accumulators::tag::mean, boo
st::accumulators::tag::variance(boost::accumulators::lazy)>, 2l>, boost::mpl::protect<boost::mpl::b
ind1<boost::mpl::quote1<boost::accumulators::as_feature, mpl_::void_>, mpl_::arg<1> >, 0> >, boost:
:mpl::aux::transform_iter<boost::mpl::v_iter<boost::accumulators::stats<boost::accumulators::tag::m
ean, boost::accumulators::tag::variance(boost::accumulators::lazy)>, 2l>, boost::mpl::v_iter<boost:
:accumulators::stats<boost::accumulators::tag::mean, boost::accumulators::tag::variance(boost::accu
mulators::lazy)>, 2l>, boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::accumulators
::as_feature, mpl_::void_>, mpl_::arg<1> >, 0> >, boost::mpl::map0<>, boost::mpl::if_<boost::mpl::i
s_sequence<mpl_::arg<2> >, boost::accumulators::detail::insert_sequence<mpl_::arg<1>, mpl_::arg<2>,
void>, boost::accumulators::detail::insert_feature<mpl_::arg<1>, mpl_::arg<2> > > >’
/usr/include/boost/mpl/fold.hpp:39:18: instantiated from ‘boost::mpl::fold<boost::accumulators::d
etail::as_feature_list<boost::accumulators::stats<boost::accumulators::tag::mean, boost::accumulato
rs::tag::variance(boost::accumulators::lazy)>, void>, boost::mpl::map0<>, boost::mpl::if_<boost::mp
l::is_sequence<mpl_::arg<2> >, boost::accumulators::detail::insert_sequence<mpl_::arg<1>, mpl_::arg
<2>, void>, boost::accumulators::detail::insert_feature<mpl_::arg<1>, mpl_::arg<2> > > >’
/usr/include/boost/accumulators/framework/depends_on.hpp:370:13: instantiated from ‘boost::accumu
lators::detail::make_accumulator_tuple<boost::accumulators::stats<boost::accumulators::tag::mean, b
oost::accumulators::tag::variance(boost::accumulators::lazy)>, double, void>’
/usr/include/boost/accumulators/framework/accumulator_set.hpp:122:5: instantiated from ‘boost::ac
cumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::mean, boos
t::accumulators::tag::variance(boost::accumulators::lazy)> >’
src/SimMany.cpp:70:7: instantiated from here
/usr/include/boost/mpl/has_key.hpp:33:1: error: no class template named ‘apply’ in ‘struct boost::m
pl::has_key_impl<boost::mpl::non_sequence_tag>’
I get reaaaaaaally lost. I can't even visually parse where one error message starts and another ends. Are there any dev tools that can help me with this?
This gets particularly scary when I'm using boost libraries. :(
STLFilt or use different compiler. Clang has supposedly better error messages (I cannot tell for sure, I didn't used it personally)