Linked Questions

2 votes
2 answers
311 views

when I try to use an initializer list for a member that contains references, I get the following error: no matching function for call to ‘std::vector<const Exp&>::vector(<brace-enclosed ...
ejgallego's user avatar
  • 6,872
0 votes
3 answers
707 views

The following "Event" code snippet shows the "pure virtual function call" error. However, as mentioned in the title, it happens only when deploying on DEBUG. What makes me curious is why it works ...
Yves Calaci's user avatar
  • 1,138
2 votes
2 answers
246 views

I am not sure why the following code is not allowed to exist: int main() { std::vector<const int> v; v.reserve(2); v.emplace_back(100); v.emplace_back(200); } In theory, reserve(...
nyarlathotep108's user avatar
0 votes
1 answer
169 views

I would like to replace a boost::bind with a lambda. Can you please advise on how to go about doing this? I have a function declared as bool myFunction(const vector<double>& input, vector<...
user1408865's user avatar
0 votes
3 answers
117 views

I have two questions. First of all I have a little problem with the understanding of const pointers to const values. I don't get why B::insert works, while C::insert results in a compiler error. I ...
Sali Ke's user avatar
  • 11
0 votes
0 answers
252 views

I am aware of the following post: Does C++11 allow vector<const T>? however I am not able to solve my problem. I am trying to define a vector with a list of const shared_ptr of my class "...
malajedala's user avatar
0 votes
1 answer
132 views

I want to convert std::vector<std::pair<const K, V>*> to std::vector<std::pair<const K, V>>. However, as you know due to pair<const K, V> I can't assign. I guess there ...
Nan Hua's user avatar
  • 3,784
0 votes
0 answers
115 views

After reading this post I tried this #include <iostream> #include <vector> int main() { const int x = 5; // x = 200; Not possible, of course. std::vector<const ...
TobiMcNamobi's user avatar
  • 4,843
0 votes
0 answers
82 views

I have this code: class A {}; // Can't modify the signature void DoSomething(std::vector<const T*>& outArray) { // do something here and fill outArray } void main(void) { std::...
Ben Pyton's user avatar
  • 348

15 30 50 per page
1 2
3