Explorar el Código

base: add operator for char + String

undefined
Sam Hocevar hace 9 años
padre
commit
78fdedf06f
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. +6
    -1
      src/lol/base/string.h

+ 6
- 1
src/lol/base/string.h Ver fichero

@@ -1,7 +1,7 @@
//
// 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>
//
// 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);
};

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

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


Cargando…
Cancelar
Guardar