Browse Source

base: add operator for char + String

undefined
Sam Hocevar 8 years ago
parent
commit
78fdedf06f
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/lol/base/string.h

+ 6
- 1
src/lol/base/string.h View File

@@ -1,7 +1,7 @@
// //
// Lol Engine // Lol Engine
// //
// Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
// © 2013—2015 Benjamin “Touky” Huet <huet.benjamin@gmail.com> // © 2013—2015 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
// //
// Lol Engine is free software. It comes without any warranty, to // Lol Engine is free software. It comes without any warranty, to
@@ -331,6 +331,11 @@ public:
static String vformat(char const *format, va_list ap); static String vformat(char const *format, va_list ap);
}; };


inline String operator +(char c, String const &s)
{
return String() + c + s;
}

inline String operator +(char const *sz, String const &s) inline String operator +(char const *sz, String const &s)
{ {
return String(sz) + s; return String(sz) + s;


Loading…
Cancel
Save