]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/codec.h
Mark constructors and destructors as default where appropriate
[libs/core.git] / source / stringcodec / codec.h
index 1b893470c6e9462993d10953e36952b4fc08b6d1..f434ed82e597c706b7bf54de4e24081b4447f693 100644 (file)
@@ -39,11 +39,11 @@ public:
        class Encoder
        {
        protected:
-               ErrorMode err_mode;
+               ErrorMode err_mode = THROW_ON_ERROR;
 
                Encoder(ErrorMode em): err_mode(em==DEFAULT ? THROW_ON_ERROR : em) { }
        public:
-               virtual ~Encoder() { }
+               virtual ~Encoder() = default;
 
                /** Encodes a single unicode character.  If the character can't be
                represented in this encoding, error() should be called. */
@@ -90,11 +90,11 @@ public:
        class Decoder
        {
        protected:
-               ErrorMode err_mode;
+               ErrorMode err_mode = THROW_ON_ERROR;
 
                Decoder(ErrorMode em): err_mode(em==DEFAULT ? THROW_ON_ERROR : em) { }
        public:
-               virtual ~Decoder() { }
+               virtual ~Decoder() = default;
 
                /** Decodes a single character from a string.  The iterator is advanced
                to the next character.  For stateful codecs, -1 may be returned if a
@@ -131,9 +131,9 @@ public:
        };
 
 protected:
-       Codec() { }
+       Codec() = default;
 public:
-       virtual ~Codec() { }
+       virtual ~Codec() = default;
 
        /** Returns the name of the encoding handled by this codec. */
        virtual const char *get_name() const = 0;
@@ -162,7 +162,7 @@ template<typename C>
 class StandardCodec: public Codec
 {
 private:
-       ErrorMode err_mode;
+       ErrorMode err_mode = THROW_ON_ERROR;
 
 protected:
        StandardCodec(ErrorMode em): err_mode(em==DEFAULT ? THROW_ON_ERROR : em) { }