made Char ctor explicit
This commit is contained in:
parent
bc0fc06772
commit
06cebc829e
3
Char.h
3
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
|
/* 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 */
|
* copy-on-write semantics for the non-const String::operator[] via some magic */
|
||||||
class Char
|
class Char
|
||||||
@ -17,7 +16,7 @@ private:
|
|||||||
|
|
||||||
public:
|
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;
|
operator char() const;
|
||||||
Char& operator=(char other);
|
Char& operator=(char other);
|
||||||
};
|
};
|
1
String.h
1
String.h
@ -6,7 +6,6 @@ class Char;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: think about making ctors explict
|
|
||||||
/* Design decisions:
|
/* Design decisions:
|
||||||
* - Everything related to ref-counting is the responsibility of the StringValue class
|
* - 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
|
* - Anything dynamically allocated is owned (and thus once deleted) by the StringValue class
|
||||||
|
Loading…
Reference in New Issue
Block a user