template function problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All!

Can you take me advice , where can be problem:
in my one hpp file resides folows teplatezy fynction

GCC 3.4 - Cygwin , MinGw and etc

#include <map>
using namespace std;

template<class Key, class Value>
Value* map_find(const Key &key, const map<Key, Value*> &m)
{
 std::map<Key, Value*>::const_iterator i = m.find(key);

 if(i == m.end())
   return (Value*)0;
 else
   return i->second;

   return (Value*)0;
}


At parce moment in Cpp file (in INCLUDE section , not even using),
I have got error

"Expected ';' before i"
"i" undeclared

------------------------------------------------------------------------------------------------
Where is a problem - for Instance at VisualC++ I don't have such a problem.


Thank's
Aleksei

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux