I'm trying to do this:

```
typedef std::map<std::string, time_t> my_map;
const mymap& some_function();

class bla
{
private:
  my_map::iterator current
  bla(const mymap& m) : current(m.begin())
  {   }
}

```

And it's not working. The somewhat more convoluted real error message is:

> 
> error: no matching function for call to 'std::\_Rb\_tree\_iterator, long int> >::\_Rb\_tree\_iterator(std::map, long int>::const\_iterator)'
> 
> 
> 

I tried moving the initialization/assignment to the constructor body:

```
{ current = m.begin(); }

```

Which didn't work either. So I thought, the type of `current` is wrong, so I just let the compiler deduce that:

```
...
   decltype(my_map::begin()) current;
...

```

Which doesn't work either.

All I need is an iterator member that is set at `bla` construction time, so I don't have to explicitly set it in some stupid extra function and can iterate over the map externally through:

```
bool bla::do_stuff(...output...)
{ 
    if(current = m.end())
        return false;
    balblabla(current);
    ++current;
    return true;
}

```