I get the error with following code (error.cpp):
#include <map>
#include <functional>
#include <vector>
int main()
{
std::map<
int, std::map< std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string,
std::map<std::string, std::string>
> > >
> > >
> > >
> > >
> > >
> > >
> > oups;
}
When compiling with debug flag:
g++ error.cpp -g -o error
My system is Ubuntu 18.04 with g++ 7.5.0 running as a VM. RAM is 5GB and Swap is 2.5GB. Hard disk space left 1GB.
Is this normal? A bug? A limitation?
What would be a "nicer" alternative for above code ? (c++14)
You have 8+7+6 strings in that definition, right? So, I'd say what you have on your hands is a relation of arity 21. Why not try:
constexpr const std::size_t my_arity = 21;
std::unordered_set<std::array<std::string, my_arity>> oups;
instead?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With