X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftag.h;h=28b4fa010e8b0f12980df476f7ac8160a2c922fb;hp=b2d4fd512b9a10c4c777950eda43ed8943005b9e;hb=e1e69c49b7727223a43cdc2deac4f1c03a3e3aba;hpb=19583522999f9ca2cddb178691633bc20f714b01 diff --git a/source/tag.h b/source/tag.h index b2d4fd51..28b4fa01 100644 --- a/source/tag.h +++ b/source/tag.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_TAG_H_ #define MSP_GL_TAG_H_ @@ -13,6 +6,10 @@ Distributed under the LGPL namespace Msp { namespace GL { +/** +Provides transparent string-to-hash conversion for faster comparison. An empty +string is guaranteed to have an id of 0. +*/ struct Tag { unsigned id; @@ -20,6 +17,9 @@ struct Tag Tag(): id(0) { } Tag(const char *); Tag(const std::string &s); + + bool operator<(const Tag &t) const { return id