[Mesa-dev] [PATCH 1/3] clover: add a simple compat::pair
std::pair is not c++98/c++11 safe --- src/gallium/state_trackers/clover/util/compat.hpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp index 7305577..dd20ef0 100644 --- a/src/gallium/state_trackers/clover/util/compat.hpp +++ b/src/gallium/state_trackers/clover/util/compat.hpp @@ -380,6 +380,12 @@ namespace clover { mutable vector v; }; + template + struct pair { + T1 first; + T2 second; + }; + template bool operator==(const vector_ref &a, const vector_ref &b) { -- 2.1.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] clover: add a simple compat::pair
EdB writes: > std::pair is not c++98/c++11 safe > --- > src/gallium/state_trackers/clover/util/compat.hpp | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/src/gallium/state_trackers/clover/util/compat.hpp > b/src/gallium/state_trackers/clover/util/compat.hpp > index 7305577..dd20ef0 100644 > --- a/src/gallium/state_trackers/clover/util/compat.hpp > +++ b/src/gallium/state_trackers/clover/util/compat.hpp > @@ -380,6 +380,12 @@ namespace clover { > mutable vector v; >}; > > + template Please use "typename" instead of "class" in template arguments for consistency. > + struct pair { A default constructor would be useful here. Other than that this looks good. > + T1 first; > + T2 second; > + }; > + >template >bool >operator==(const vector_ref &a, const vector_ref &b) { > -- > 2.1.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev pgpa20FIcLZfd.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] clover: add a simple compat::pair
Francisco Jerez writes: > EdB writes: > >> std::pair is not c++98/c++11 safe >> --- >> src/gallium/state_trackers/clover/util/compat.hpp | 6 ++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/src/gallium/state_trackers/clover/util/compat.hpp >> b/src/gallium/state_trackers/clover/util/compat.hpp >> index 7305577..dd20ef0 100644 >> --- a/src/gallium/state_trackers/clover/util/compat.hpp >> +++ b/src/gallium/state_trackers/clover/util/compat.hpp >> @@ -380,6 +380,12 @@ namespace clover { >> mutable vector v; >>}; >> >> + template > > Please use "typename" instead of "class" in template arguments for > consistency. > >> + struct pair { > > A default constructor would be useful here. > Hmm, or maybe a two-argument constructor initializing both members instead, in order to make possible a small clean-up for PATCH 3 that I'll propose in a minute. > Other than that this looks good. > >> + T1 first; >> + T2 second; >> + }; >> + >>template >>bool >>operator==(const vector_ref &a, const vector_ref &b) { >> -- >> 2.1.1 >> >> ___ >> mesa-dev mailing list >> mesa-dev@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev pgpZPVJCDRLg8.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev