diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-04-03 07:29:36 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-04-03 07:29:36 +0200 |
commit | 33defc102694ea3af83d7f20fd525f08cc7d174d (patch) | |
tree | d4990ce2288822c79f2d8961e3102bfccf5edac6 | |
parent | 983cb6320349852b16a4edc1c71d45f94b689544 (diff) |
Adding a better constructor for strings.
-rw-r--r-- | includes/BString.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/includes/BString.h b/includes/BString.h index 29f3d22..b388777 100644 --- a/includes/BString.h +++ b/includes/BString.h @@ -16,6 +16,8 @@ class String : private std::string { public: String() : std::string() { } String(const char * str) : std::string(str ? str : "") { } + template<ssize_t L> + String(const char str[L]) : std::string(str, L) { } String(const char * str, size_t n) : std::string(str ? str : "", str ? n : 0) { } String(char c) { set("%c", c); } String(int32_t i) { set("%i", i); } |