From 06cebc829e956d2f185bf34aa87eda199cd0fa8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 23 Oct 2016 18:00:22 +0200 Subject: [PATCH] made Char ctor explicit --- Char.h | 3 +-- String.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Char.h b/Char.h index 970a9fc..3b98e18 100644 --- a/Char.h +++ b/Char.h @@ -5,7 +5,6 @@ class StringValue; -// TODO: think about making ctors explict /* This class provides a simple wrapper for a char primitive, and implements * copy-on-write semantics for the non-const String::operator[] via some magic */ class Char @@ -17,7 +16,7 @@ private: public: - Char(size_t index, String& string) :_index(index), _string(string) {} + explicit Char(size_t index, String& string) :_index(index), _string(string) {} operator char() const; Char& operator=(char other); }; \ No newline at end of file diff --git a/String.h b/String.h index 582b868..75eab5f 100644 --- a/String.h +++ b/String.h @@ -6,7 +6,6 @@ class Char; -// TODO: think about making ctors explict /* Design decisions: * - Everything related to ref-counting is the responsibility of the StringValue class * - Anything dynamically allocated is owned (and thus once deleted) by the StringValue class