I am coding an implementation/copy of the std::vector container, and I am having some issues with its iterators. My random_access_iterator and vector ...
I am coding an implementation/copy of the std::vector container, and I am having some issues with its iterators. My random_access_iterator and vector ...
Does someone know why the gcc compiler reports an issue "error: invalid operands to binary expression ('iterator' (aka '__list_const_iterator<int ...
I want to define freestanding operators (op==, op<, etc.) for my iterator class, but I'm struggling with the proper syntax: ...
I am coding a vector class with iterators for a school exercice. I am getting the following error and I don't know how to go about it: 'no suitable u ...
Edited to include MWE (removing example-lite) and added details about compilation and Valgrind output. I am using the mutable keyword to achieve the ...
I'm attempting to get a basic constant forward-iterator to work in C++. My intention is to use the iterator in contexts similar to the following: ...
I am trying to implement a Bayesian estimator for the card game Avalon. The game has five rounds and each round contains at most five proposals made b ...
#include <iostream> #include <vector> using namespace std; void print(vector<int>::const_iterator &beg, vector<int>::con ...
I have the below snippet of code (which you can run here: http://coliru.stacked-crooked.com/a/2f62134b5c125051) Can someone please explain me why f ...
I am trying to implement a custom std compliant container class with an iterator. To do so, i started to define the public type definitions to be used ...
I'm trying to overload operator << of a map within a struct, but getting a compilation error: no suitable user-defined conversion from "std: ...
I am reading strings with the following syntax: Since a real list can have hundreds of elements, and I need only read operations (checking if value ...
I am having a custom template class - I want to be able to have a const iterator begin to myClass and const iterator end to myClass that would able ...
I have a prepopulated std::vector<uint64_t> that I am passing to my constexpr function by constant reference and another std::vector<uint64_t ...
I have the following code which does not compile at all. It says that I cannot convert const Node to Node& but Node is not const nor methods of A ...
I am implementing a function that wants to loop over a number of elements in an std::array, but I don't really care how long the std::array is. So I w ...
Is there such a thing as a std::istream const iterator? The following code won't compile because the std::istream_iterator in foo() can't bind to the ...
In this code I have a linked list and an iterator to it. Also I have a const iterator which inherits from the normal iterator and when dereferenced, ...
Suppose I have a templated function which has a parameter used as an iterator (albeit without any concepts/requirements - C++17 or earlier), named my_ ...
I am trying to implement a binary search tree container. At the moment I have to implement a find() function that is able to return an iterator or a c ...