Click to See Complete Forum and Search --> : compiling map template


Nick Pickett
May 24th, 1999, 06:11 AM
I 'm trying to compile a program using the map template from the standard template library. However, it will not compile and keep receiving syntax errors. What am I doing wrong?


My code:

#ifndef EVALUATOR_H
#define EVALUATOR_H

#ifdef _MSC_VER
#pragma warning (disable: 4786)
#endif

#include <string>
#include <map>

using namespace Coyote;

namespace Coyote
{
struct VarName
{
char Text[255];
};


class Evaluator
{
private:
map<VarName, double, less<VarName>> Vars;
}
}

#endif

James Curran
July 6th, 2001, 04:01 PM
map<VarName, double, less<VarName> > Vars;
// put a space between the two >'s
// or the compiler gets confused




Truth,
James
http://www.NJTheater.com
http://www.NovelTheory.com
I don't do it for the points (OK, maybe I do), but rating a post is a good way for me to know if I helped.