justinhj / astar-algorithm-cpp

Implementations of the A* algorithm in C++
MIT License
428 stars 190 forks source link

Can't compile in VS2010 express #4

Closed ghronkrepps closed 10 years ago

ghronkrepps commented 10 years ago

I made my own version of the node class and it wouldn't compile, so I tried to compile both example files and both give me this error: h:\programming\c++\astar-algorithm-cpp-master\stlastar.h(60): error C2338: UserState must be derived from AStarState! h:\programming\c++\astar-algorithm-cpp-master\8puzzle.cpp(569) : see reference to class template instantiation 'AStarSearch' being compiled with [ UserState=PuzzleState ]

I didn't edit any of the files, is this a known issue?

ghronkrepps commented 10 years ago

Removing:

if (defined(cplusplus) && cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1600)

static_assert(is_base_of<AStarState<UserState>, UserState>::value, "UserState must be derived from AStarState!");

endif

fixed the issue, and the algorithm is working nicely now. Doesn't seem like this is necessary anymore? Thank you

justinhj commented 10 years ago

Hi there

I'm afraid I don't have access to a windows compiler. If this fixes your problem I'll remove it from the code. Thanks for your input.