I have a tree structure that internally uses unordered map
#include <unordered_map>
struct Node {
std::unordered_map<int, Node> children;
};
int main() {
Node a;
}
It works just fine on Apple clang 11.0.3 and MSVC v19.24, but it fails to compile on clang 10.0.0 and gcc 10.1
While regular std::map works just fine on all compilers. I failed to find the reason for this discrepancy. Is there any way to use std::unordered_map as a value for itself? Or pointers is the only solution here?
Here's the compiler explorer link https://godbolt.org/z/6eYch9
Here's an error from gcc:
#3 with x86-64 gcc 10.1
In file included from /opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/unordered_map:43,
from <source>:1:
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/stl_pair.h:
In instantiation of 'struct std::pair<const int, Node>':
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/ext/aligned_buffer.h:91:28:
required from 'struct __gnu_cxx::__aligned_buffer<std::pair<const int,
Node> >'
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/hashtable_policy.h:233:43:
required from 'struct
std::__detail::_Hash_node_value_base<std::pair<const int, Node> >'
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/hashtable_policy.h:279:12:
required from 'struct std::__detail::_Hash_node<std::pair<const int,
Node>, false>'
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/hashtable_policy.h:1973:13:
required from 'struct
std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<const
int, Node>, false> > >'
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/hashtable.h:173:11:
required from 'class std::_Hashtable<int, std::pair<const int, Node>,
std::allocator<std::pair<const int, Node> >,
std::__detail::_Select1st, std::equal_to<int>, std::hash<int>,
std::__detail::_Mod_range_hashing,
std::__detail::_Default_ranged_hash,
std::__detail::_Prime_rehash_policy,
std::__detail::_Hashtable_traits<false, false, true> >'
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/unordered_map.h:105:18:
required from 'class std::unordered_map<int, Node>'
<source>:4:39: required from here
/opt/compiler-explorer/gcc-10.1.0/include/c++/10.1.0/bits/stl_pair.h:218:11:
error: 'std::pair<_T1, _T2>::second' has incomplete type
218 | _T2 second; ///< The second member
| ^~~~~~
<source>:3:8: note: forward declaration of 'struct Node'
3 | struct Node {
| ^~~~
Compiler returned: 1
STL containers are not required to work with incomplete types. If you don't mind extra indirection, then the workaround is std::map<int, std::unique_ptr<Node>>
It's the same problem as doing e.g.
struct Node
{
Node child; // An instance of the full structure
};
You can't use a structure (or class) before it's fully defined, which it is at the closing }.
You can however define pointers to the structure, because then the compiler don't need the full structure definition, only know the name of the structure:
struct Node
{
Node* child; // Pointer to the structure
};
So to solve your problem, you need a map of pointers:
std::unordered_map<int, Node*> children;
Running into this while coding a Trie data structure I've noticed that in the latest of clang (v14) and GCC (v12) I don't get the error and my code operates as expected but anything below those versions (on godbolt.com) I get the same error. This is all using -std=c++14 so it's should not be related to the standard.
Related
I'm trying to compile the Statemachine example from boost-mpl (located in libs/mpl/examples/fsm/player2.cpp), but it fails with boost version 1.37 and g++ 4.8.2. With boost version 1.56 and the same compiler, the build succeeds. Unfortunately, due to some platform constraints, I cannot switch to version 1.56.
I'm not expecting anyone to look into the above mentioned lengthy example, therefore I identified a minimal code snippet which illustrates the problem:
#include <boost/mpl/fold.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/placeholders.hpp>
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
//Basic queue datatype
template< class CURRENT, class NEXT >
struct queue_element
{
typedef typename CURRENT::mytype mytype;
};
//type to be put at the end of the queue
struct default_queue_element
{
};
template <class TYPE>
struct wrapper{
typedef TYPE mytype;
};
typedef mpl::vector<wrapper<int>, wrapper<char> > myvector;
//the following fold expression should create this type:
typedef queue_element<wrapper<char>, queue_element<wrapper<int>,
default_queue_element> > this_type_should_be_created;
//This typedef fails to compile with boost Version 1.37,
//but works perfectly with version 1.56
typedef typename
mpl::fold<
myvector
,default_queue_element
,queue_element<_2,_1>
>::type
generate_queue;
With boost 1.37, g++ issues the following errors:
foldtest2.cpp: In instantiation of ‘struct queue_element<mpl_::arg<2>, mpl_::arg<1> >’:
../boost_1_37_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85:5: required from ‘const int boost::mpl::aux::template_arity_impl<queue_element<mpl_::arg<2>, mpl_::arg<1> >, 1>::value’
../boost_1_37_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:93:5: required from ‘const int boost::mpl::aux::template_arity<queue_element<mpl_::arg<2>, mpl_::arg<1> > >::value’
../boost_1_37_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98:30: required from ‘struct boost::mpl::aux::template_arity<queue_element<mpl_::arg<2>, mpl_::arg<1> > >’
../boost_1_37_0/boost/mpl/aux_/preprocessed/gcc/apply.hpp:67:8: required from ‘struct boost::mpl::apply2<queue_element<mpl_::arg<2>, mpl_::arg<1> >, default_queue_element, wrapper<int> >’
../boost_1_37_0/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp:67:85: required from ‘struct boost::mpl::aux::fold_impl<2, boost::mpl::v_iter<boost::mpl::vector<wrapper<int>, wrapper<char> >, 0l>, boost::mpl::v_iter<boost::mpl::vector<wrapper<int>, wrapper<char> >, 2l>, default_queue_element, queue_element<mpl_::arg<2>, mpl_::arg<1> > >’
../boost_1_37_0/boost/mpl/fold.hpp:39:18: required from ‘struct boost::mpl::fold<boost::mpl::vector<wrapper<int>, wrapper<char> >, default_queue_element, queue_element<mpl_::arg<2>, mpl_::arg<1> > >’
foldtest2.cpp:39:6: required from here
foldtest2.cpp:15:38: error: no type named ‘mytype’ in ‘struct mpl_::arg<2>’
typedef typename CURRENT::mytype mytype;
Is there a work-around to make the code compile with boost 1.37? I have been searching the web for quite some time. If nevertheless the question has already been answered somewhere, I would be grateful if you could point that out.
Looks to be very simply a bug in that ancient(¹) version of boost.
A quick bisection tells me it was fixed in v1.43.0(²). Release notes don't disclose the secret, but git does:
c5621d9 MPL: merge fix for ticket #1992 boost::mpl::zip_view does not support use as a metafunction with ::type
31a2c78 MPL: merge fix for ticket #4061 [MPL] gcc-4.5 compilation problems related to arity_helper
It clearly appears to be the latter (confirmed by compiling against 31a2c78).
So your fix this single line in include/boost/mpl/aux_/template_arity.hpp(³):
sizeof(arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1
should be
sizeof(::boost::mpl::aux::arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1
Of course the proper way to fix this is to use a supported version of boost
¹ (November 3rd, 2008)!!
² (May 6th, 2010)
³ warning: also present in several copies generated in preprocessed versions of the header
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have two integers and I want to create a hash map which maps the two integers to another integer.
In order to so I created the following program, however it is giving me errors:
#include <iostream>
#include <unordered_map>
using namespace std;
int main()
{
std::pair <int, int> var1;
var1=std::make_pair(10,20);
cout<<"\n var1.f="<<var1.first<<"\t 2."<<var1.second<<"\n";
std::unordered_map <std::pair <int,int>, int> yeah;
return 0;
}
Is there some way to get rid of the errors?
Is there some way to do the same in a scalable manner?
Error:
n file included from /usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable.h:35:0,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/unordered_map:47,
from main.cpp:2:
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable_policy.h: In instantiation of ‘struct std::__detail::_Hash_code_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>’:
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable_policy.h:1402:10: required from ‘struct std::__detail::_Hashtable_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >’
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable.h:174:11: required from ‘class std::_Hashtable<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::allocator<std::pair<const std::pair<int, int>, int> >, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >’
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/unordered_map.h:100:18: required from ‘class std::unordered_map<std::pair<int, int>, int>’
main.cpp:12:50: required from here
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type ‘struct std::hash<std::pair<int, int> >’
struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
^
In file included from /usr/local/gcc-4.8.1/include/c++/4.8.1/bits/basic_string.h:3033:0,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/string:52,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/bits/locale_classes.h:40,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/bits/ios_base.h:41,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/ios:42,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/ostream:38,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/iostream:39,
from main.cpp:1:
/usr/local/gcc-4.8.1/include/c++/4.8.1/bits/functional_hash.h:58:12: error: declaration of ‘struct std::hash<std::pair<int, int> >’
struct hash;
^
In file included from /usr/local/gcc-4.8.1/include/c++/4.8.1/bits/hashtable.h:35:0,
from /usr/local/gcc-4.8.1/include/c++/4.8.1/unordered_map:47,
from main.cpp:2:
I assume the error is something like "The C++ Standard doesn't provide a hash for this type"? The problem is that anything you use as the key in an unordered map must be hashable, and there is no built-in hash function for pair<int, int>. A couple possibilities are:
-Write your own hasher for pair<int, int> and use it as the third template parameter to the unordered_map. This post may be able to help with that.
-Use std::unordered_map<int, std::unordered_map<int, int>> instead. Be careful not to accidentally create copies of the inner map when you're performing operations.
-Use map instead of unordered_map. This will give you logarithmic operations instead of constant-time, but unless the map is huge and you're doing tons of lookups per second, you won't notice the difference.
Edit in response to your edit: Yes, that's what those error messages amount to, though they don't say it in quite as friendly a fashion as Microsoft's compiler does. :)
Platform: MinGW64 (rubenvb 4.7.2), Windows 7 (64), Qt 4.8.2
Given code segment as follow:
/* type definition */
typedef long T_PSIZE;
struct A { T_PSIZE myArray[10]; };
struct B { T_PSIZE myArray[10]; };
/* declare variable */
A a;
B b;
std::copy(a.myArray[0], a.myArray[10], &b.myArray);
I don't know why the compiler throws the following error messages (similar messages also shown when changed from 'typedef long T_PSIZE;' to 'typedef int T_PSIZE;'):
> c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:
> In instantiation of '_OI std::__copy_move_a(_II, _II, _OI) [with bool
> _IsMove = false; _II = long int; _OI = long int (*)[9]]': c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:422:39:
> required from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool
> _IsMove = false; _II = long int; _OI = long int (*)[9]]' c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:454:18:
> required from '_OI std::copy(_II, _II, _OI) [with _II = long int; _OI
> = long int (*)[9]]' ..\InfluSimHKPrototype\SimApplication.cpp:114:36: required from here
> c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:375:57:
> error: no type named 'value_type' in 'struct std::iterator_traits<long
> int>'
> c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:377:64:
> error: no type named 'iterator_category' in 'struct
> std::iterator_traits<long int>'
> c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:381:57:
> error: no type named 'value_type' in 'struct std::iterator_traits<long
> int>'
> c:\mingw\rubenvb-4.7.2-64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:384:70:
> error: no type named 'iterator_category' in 'struct
> std::iterator_traits<long int>'
It seems that the type 'long int' cannot be recognized by the compiler's template engine. I used the similar statement with array of 'ordinary int' and it works great. I'm not using any STL containers as I know exactly the size of the target array, so I don't think I need to re-implement something like back_inserter. Do I missed something?
Note: I'm not sure if the question like this help. (Or how can I can get the 'full' qualified name for the statement to work on typedef-ed variables?)
You probably meant:
std::copy(&a.myArray[0], &a.myArray[10], &b.myArray[0]);
or
std::copy(a.myArray, a.myArray + 10, b.myArray);
a.myArray[0] is just a long, not a pointer into an array of long which std::copy requires. Also, the type of the output parameter needs to be compatible with the type of the object being copied. &b.myArray has type long (*)[10] whereas you need to supply a parameter of type long*.
When programming in c++ STL, or intensively using 'templatization', and some compiling error happens, often the error report is really long, and often too much not needed information is given.
I'm talking about gcc, i don't know if with other compilers is different, but some times even for just a typo, it takes a while to catch the error purging the
<ns::type<ns::type<ns::type, ns::type<...><ns::type<...> > > > >
I'm looking for some compiler flag, trick, workaround or methodology ( i currently copy past the error and put on two lines what i have and what compiler use to want and removing variables bookmarks... (kinda sad procedure for a not-so-uncommon ctrl+s non well performed)) that could make this task quicker or just helping me ( even only some IDE error syntax highlight... )
STLFilt: An STL Error Message Decryptor for C++ is a popular tool to filter these verbose error messages and turn them into something more legible.
From their website:
STLFilt was initially conceived as a teaching aid, to allow students
taking C++ and/or STL-specific workshops to make sense of typically
overbloated STL error messages. Today, however, even some C++ experts
have adopted STLFilt for use in everyday development. The results may
not always be perfect, but most of the time the information lost
during Decryption is not critical to the application being debugged.
The rest of the time, Decryption is easy enough to bypass.
The distribution for each platform (compiler/library set) is
self-contained and tuned to the idiosyncrasies of that platform. Each
Perl script performs basic regex substitutions for all the standard
(and extended, if present in the library) STL components, while
certain versions of the script go further with respect to message
ordering, line wrapping, library header error treatment, etc., as I
unilaterally deemed appropriate for that platform.
Here's a demo run that shows how it can be useful:
The source program:
#include <map>
#include <algorithm>
#include <cmath>
const int values[] = { 1,2,3,4,5 };
const int NVALS = sizeof values / sizeof (int);
int main()
{
using namespace std;
typedef map<int, double> valmap;
valmap m;
for (int i = 0; i < NVALS; i++)
m.insert(make_pair(values[i], pow(values[i], .5)));
valmap::iterator it = 100; // error
valmap::iterator it2(100); // error
m.insert(1,2); // error
return 0;
}
First, an unfiltered run using the MinGW gcc 3.2 compiler:
d:\src\cl\demo>c++2 rtmap.cpp
rtmap.cpp: In function `int main()':
rtmap.cpp:19: invalid conversion from `int' to `
std::_Rb_tree_node<std::pair<const int, double> >*'
rtmap.cpp:19: initializing argument 1 of `std::_Rb_tree_iterator<_Val, _Ref,
_Ptr>::_Rb_tree_iterator(std::_Rb_tree_node<_Val>*) [with _Val =
std::pair<const int, double>, _Ref = std::pair<const int, double>&, _Ptr =
std::pair<const int, double>*]'
rtmap.cpp:20: invalid conversion from `int' to `
std::_Rb_tree_node<std::pair<const int, double> >*'
rtmap.cpp:20: initializing argument 1 of `std::_Rb_tree_iterator<_Val, _Ref,
_Ptr>::_Rb_tree_iterator(std::_Rb_tree_node<_Val>*) [with _Val =
std::pair<const int, double>, _Ref = std::pair<const int, double>&, _Ptr =
std::pair<const int, double>*]'
E:/GCC3/include/c++/3.2/bits/stl_tree.h: In member function `void
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::insert_unique(_II,
_II) [with _InputIterator = int, _Key = int, _Val = std::pair<const int,
double>, _KeyOfValue = std::_Select1st<std::pair<const int, double> >,
_Compare = std::less<int>, _Alloc = std::allocator<std::pair<const int,
double> >]':
E:/GCC3/include/c++/3.2/bits/stl_map.h:272: instantiated from `void std::map<_
Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Input
Iterator = int, _Key = int, _Tp = double, _Compare = std::less<int>, _Alloc = st
d::allocator<std::pair<const int, double> >]'
rtmap.cpp:21: instantiated from here
E:/GCC3/include/c++/3.2/bits/stl_tree.h:1161: invalid type argument of `unary *
'
And a filtered run using the gcc-specific Proxy c++:
d:\src\cl\demo>c++ rtmap.cpp
*** {BD Software Proxy c++ for gcc v3.01} STL Message Decryption is ON! ***
rtmap.cpp: In function `int main()':
rtmap.cpp:19: invalid conversion from `int' to `iter'
rtmap.cpp:19: initializing argument 1 of `iter(iter)'
rtmap.cpp:20: invalid conversion from `int' to `iter'
rtmap.cpp:20: initializing argument 1 of `iter(iter)'
stl_tree.h: In member function `void map<int,double>::insert_unique(_II, _II)':
[STL Decryptor: Suppressed 1 more STL standard header message]
rtmap.cpp:21: instantiated from here
stl_tree.h:1161: invalid type argument of `unary *'
STL Decryptor reminder:
Use the /hdr:L option to see all suppressed standard lib headers
[Note: demo runs were performed in an 80-column console window with
STLFilt's intelligent line wrapping enabled, and with internal
switches set to produce messages as terse as possible. More detail is
available by tailoring the Decryptor's options.]
The only downside I can see is that it mislabels the C++ Standard Library. :(
Here's a relevant journal article by STLFilt's author.
A few people have made tools to perform this, as there's nothing inbuilt. Tonnes on Google, but the top result returns: http://www.bdsoft.com/tools/stlfilt.html
It should be compatible with visual studio and gcc.
edit::
I need to type less to actually get input in time :)
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)