Fucked C++ question:
I have a struct B, defined by me. I had the code
auto &b = bees.emplace_back(); //vector
b.value = 3;
A change *ELSEWHERE IN THE CODE* caused this to suddenly start failing with
"auto cannot be inferred"
changed the line to
B &b = bees.emplace_back();
The error became ("bees" underlined):
"initial value of reference to non-const must be an lvalue" (??)
Replaced the whole thing with
B b;
b.value = e;
bees.push_back(b);
The compiler allows this.
C++17.
wha ??? ?? ?????
We are seeing at least three cases where what looks like a totally normal emplace() or emplace_back() call is failing, in code which previously worked, with baffling errors. One place is claiming that std::pair does not have any constructors that take two arguments.
???????
(before you ask "did you #include <utility>": yes I did)