From: Amos Jeffries Date: Sat, 8 Jul 2017 19:14:49 +0000 (+1200) Subject: Cleanup: update InstanceId to C++11 X-Git-Tag: M-staged-PR71~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=827df6a444b385343a465dd7ee89ff3b4a487f03;p=thirdparty%2Fsquid.git Cleanup: update InstanceId to C++11 ... fixing some ignored-qualifiers warnings --- diff --git a/src/base/InstanceId.h b/src/base/InstanceId.h index 79e2be2aa4..c751277134 100644 --- a/src/base/InstanceId.h +++ b/src/base/InstanceId.h @@ -25,7 +25,7 @@ class InstanceId public: typedef unsigned int Value; ///< id storage type; \todo: parameterize? - InstanceId(): value(0) {change();} + InstanceId() {change();} operator Value() const { return value; } bool operator ==(const InstanceId &o) const { return value == o.value; } @@ -33,22 +33,22 @@ public: void change(); /// prints class-pecific prefix followed by ID value; \todo: use HEX for value printing? - std::ostream &print(std::ostream &os) const; + std::ostream &print(std::ostream &) const; /// returns the class-pecific prefix - const char * const prefix() const; + const char * prefix() const; public: - Value value; ///< instance identifier + Value value = 0; ///< instance identifier private: - InstanceId(const InstanceId& right); ///< not implemented; IDs are unique - InstanceId& operator=(const InstanceId &right); ///< not implemented + InstanceId(const InstanceId &); ///< not implemented; IDs are unique + InstanceId& operator=(const InstanceId &); ///< not implemented }; /// convenience macro to instantiate Class-specific stuff in .cc files #define InstanceIdDefinitions(Class, pfx) \ - template<> const char * const \ + template<> const char * \ InstanceId::prefix() const { \ return pfx; \ } \