forked from qt-creator/qt-creator
Utils: Add constructor for character pointer
Change-Id: I12bd787caf911502a666de2c324bb74b8bd7b0aa Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -114,6 +114,15 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template<typename Type,
|
||||
typename = typename std::enable_if<std::is_pointer<Type>::value>::type
|
||||
>
|
||||
SmallString(Type characterPointer) noexcept
|
||||
: SmallString(characterPointer, std::strlen(characterPointer))
|
||||
{
|
||||
static_assert(!std::is_array<Type>::value, "Input type is array and not char pointer!");
|
||||
}
|
||||
|
||||
SmallString(const QString &qString)
|
||||
: SmallString(SmallString::fromQString(qString))
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user