diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/stringutils.hxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sal/inc/rtl/stringutils.hxx b/sal/inc/rtl/stringutils.hxx index 3bf72c54064e..19c1bf460fb4 100644 --- a/sal/inc/rtl/stringutils.hxx +++ b/sal/inc/rtl/stringutils.hxx @@ -50,7 +50,8 @@ namespace internal { /* These templates use SFINAE (Substitution failure is not an error) to help distinguish the various -plain C string types: char*, const char*, char[N] and const char[N]. There are 2 cases: +plain C string types: char*, const char*, char[N], const char[N], char[] and const char[]. +There are 2 cases: 1) Only string literal (i.e. const char[N]) is wanted, not any of the others. In this case it is necessary to distinguish between const char[N] and char[N], as the latter would be automatically converted to the const variant, which is not wanted (not a string literal @@ -90,6 +91,16 @@ struct NonConstCharArrayDetector< char[ N ], T > { typedef T Type; }; +template< typename T > +struct NonConstCharArrayDetector< char[], T > +{ + typedef T Type; +}; +template< typename T > +struct NonConstCharArrayDetector< const char[], T > +{ + typedef T Type; +}; template< typename T1, typename T2 > struct ConstCharArrayDetector |