neubig / travatar

This is a repository for the Travatar forest-to-string translation decoder
GNU Lesser General Public License v3.0
28 stars 11 forks source link

Please add std before max() functions #1

Closed vbkaisetsu closed 11 years ago

vbkaisetsu commented 11 years ago

In include/travatar/util.h, max() is used outside of the namespace std. When I build it, the following error is occured:

In file included from ./../include/travatar/hyper-graph.h:13:0, from hyper-graph.cc:8: ./../include/travatar/util.h: In instantiation of 'int travatar::CheckPtrVector(const std::vector<T>&, const std::vector<T>&) [with T = travatar::HyperEdge]': hyper-graph.cc:148:45: required from here ./../include/travatar/util.h:254:17: error: 'max' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] In file included from /usr/include/c++/4.7/deque:61:0, from /usr/include/c++/4.7/queue:61, from hyper-graph.cc:1: /usr/include/c++/4.7/bits/stl_algobase.h:254:5: note: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' declared here, later in the translation unit

Please use max() with std:: to solve it.

neubig commented 11 years ago

Great! Thank you very much.