vector_structs.cpp:23:17: error: ‘__gnu_cxx::__alloc_traits<std::allocator<main()::Layout> >::value_type {aka struct main()::Layout}’ has no member named ‘keyType’
vLayouts[0].keyType = code1;
Why is there no member named ‘keyType’? It's right there in struct Key!
Thanks gunnerfunner. Line 23 compiles now. But when it runs, line 23 gets seg fault:
1 2
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b74ac1 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib64/libstdc++.so.6
From your example, I was able to write what I needed.
Sorry about the bizarre data structures and variable names.
I updated the variable names to something more sensible.
What is bizarre about the data structures?
The following does what I want it to do, but I get the feeling there is an easier way.
'Bizarre' didn't mean it is no good. It described the abstract vs intuitively obvious nature and context of the structs. Without that context it's difficult to comment on whether there is a better way except the <multiset>'s might be a possibility?
first_key
a b
second_key
c d
first_key
e f
second_key
g h
first_key
i j
second_key
k l
first_key
m n
second_key
o p
Process returned 0 (0x0) execution time : 0.096 s
Press any key to continue.