]> git.lyx.org Git - lyx.git/blobdiff - src/support/translator.h
make doc++ able to generate the source documentation for lyx
[lyx.git] / src / support / translator.h
index 2170d5fa6a91c3b512ef0292ccf3713c1d15f63c..d150c17900e61f8ecae2d1fa64f1a2c9ae0f2cf3 100644 (file)
@@ -25,7 +25,7 @@ public:
     equal_1st_in_pair(T1 const & value) : value_(value) {}
 
     typedef std::pair<T1, T2> pair_type;
-    bool operator() (pair_type p) const {
+    bool operator() (pair_type const & p) const {
         return p.first == value_;
     }
 private:
@@ -38,7 +38,7 @@ public:
     equal_2nd_in_pair(T2 const & value) : value_(value) {}
 
     typedef std::pair<T1, T2> pair_type;
-    bool operator() (pair_type p) const {
+    bool operator() (pair_type const & p) const {
         return p.second == value_;
     }
 private:
@@ -57,13 +57,13 @@ class Translator {
 public:
     typedef T1 first_argument_type;
     typedef T2 second_argument_type;
+    typedef std::pair<T1, T2> MapPair;
+    typedef std::vector<MapPair> Map;
 
     /// c-tor.
     Translator(T1 const & t1, T2 const & t2) 
         : default_t1(t1), default_t2(t2) 
         {}
-    /// d-tor. Not virtual since it's not going to be inherited.
-    ~Translator() {}
 
     /// Add a mapping to the translator.
     void addPair(T1 const & first, T2 const & second) {
@@ -119,14 +119,10 @@ public:
     }
 
 private:
-    typedef std::pair<T1, T2> MapPair;
-    typedef std::vector<MapPair> Map;
-
     Map map;
 
-    const T1 default_t1;
-    const T2 default_t2;
-
+    T1 const default_t1;
+    T2 const default_t2;
 };
 
 #endif