Browse Source

[trac510] use boost::noncopyable instead of declaring private members

Yoshitaka Aharen 13 years ago
parent
commit
0b7c39d9dc
2 changed files with 5 additions and 7 deletions
  1. 3 4
      src/lib/statistics/counter.cc
  2. 2 3
      src/lib/statistics/counter.h

+ 3 - 4
src/lib/statistics/counter.cc

@@ -1,5 +1,7 @@
 #include <vector>
 #include <cassert>
+
+#include <boost/noncopyable.hpp>
 #include <boost/unordered_map.hpp>
 
 #include <statistics/counter.h>
@@ -11,10 +13,7 @@ const unsigned int InitialValue = 0;
 namespace isc {
 namespace statistics {
 
-class CounterImpl {
-    private:
-        CounterImpl(const CounterImpl& source);
-        CounterImpl& operator=(const CounterImpl& source);
+class CounterImpl : boost::noncopyable {
     private:
         std::vector<Counter::Value> counters_;
     public:

+ 2 - 3
src/lib/statistics/counter.h

@@ -1,6 +1,7 @@
 #ifndef __COUNTER_H
 #define __COUNTER_H 1
 
+#include <boost/noncopyable.hpp>
 #include <boost/scoped_ptr.hpp>
 
 namespace isc {
@@ -9,10 +10,8 @@ namespace statistics {
 // forward declaration for pImpl idiom
 class CounterImpl;
 
-class Counter {
+class Counter : boost::noncopyable {
     private:
-        Counter(const Counter& source);
-        Counter& operator=(const Counter& source);
         boost::scoped_ptr<CounterImpl> impl_;
     public:
         typedef unsigned int Type;