Re: template function problem

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

 



Alex wrote:
Hello All!

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

It can be compiled with the following changes.
#include <map>
using namespace std;

template < class Key, class Value >
  Value * map_find (const Key & key, const std::map < Key, Value * >&m)
{  //                                      ^^^
  typename std::map < Key, Value * >::const_iterator i = m.find (key);
//^^^^^^^^
  if (i == m.end ())
    return (Value *) 0;
  else
    return i->second;

  return (Value *) 0;
}

Denis

[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