# Map iterator

**URL:** <https://forum.kirupa.com/t/map-iterator/211397>\
**Category:** Uncategorized\
**Created:** [December 31, 2006, 12:15pm UTC](https://forum.kirupa.com/t/map-iterator/211397 "2006-12-31T12:15:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danii](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Danii](https://forum.kirupa.com/u/Danii)\
**Post date:** [December 31, 2006, 12:15pm UTC](https://forum.kirupa.com/t/map-iterator/211397/1 "2006-12-31T12:15:54Z")

</div>

```auto

template<class S, class T>
void StdDate<S,T>::empty()
{
   std::map<S,T>::iterator it;
}

```

that piece of code wont work, ive been googling for hours but can’t find an answer… compiler says:

-error: expected `;’ before ‘it’  
-error: dependent-name ‘std::map\<S,T,std::less\<\_Key\>,std::  
allocator\<std::pair\<const \_Key, \_Tp\> \> \>::iterator’ is parsed as a non-  
type, but instantiation yields a type

if i switch it it std::map\<int,int\>::iterator it; it works fine, but tht was just done for testing to see if the syntax was wrong… so why can’t i use S and T?
