mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 14:24:35 +01:00
Fixed constness detection of const char[] arrays
This commit is contained in:
parent
96c57718c4
commit
4e730ecc7e
@ -1388,14 +1388,14 @@ template <typename T>
|
||||
inline Binding<T>* in(T& t, const std::string& name = "")
|
||||
/// Convenience function for a more compact Binding creation.
|
||||
{
|
||||
return new Binding<T>(t, name, AbstractBinding::PD_IN);
|
||||
return use(t, name);
|
||||
}
|
||||
|
||||
|
||||
inline Binding<NullData>* in(const NullData& t, const std::string& name = "")
|
||||
/// NullData overload.
|
||||
{
|
||||
return new Binding<NullData>(const_cast<NullData&>(t), name, AbstractBinding::PD_IN);
|
||||
return use(t, name);
|
||||
}
|
||||
|
||||
|
||||
@ -1403,6 +1403,7 @@ template <typename T>
|
||||
inline Binding<T>* out(T& t)
|
||||
/// Convenience function for a more compact Binding creation.
|
||||
{
|
||||
poco_static_assert (!IsConst<T>::VALUE);
|
||||
return new Binding<T>(t, "", AbstractBinding::PD_OUT);
|
||||
}
|
||||
|
||||
@ -1411,6 +1412,7 @@ template <typename T>
|
||||
inline Binding<T>* io(T& t)
|
||||
/// Convenience function for a more compact Binding creation.
|
||||
{
|
||||
poco_static_assert (!IsConst<T>::VALUE);
|
||||
return new Binding<T>(t, "", AbstractBinding::PD_IN_OUT);
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,17 @@ struct IsConst<const T>
|
||||
};
|
||||
|
||||
|
||||
template <typename T, int i>
|
||||
struct IsConst<const T[i]>
|
||||
/// Specialization for const char arrays
|
||||
{
|
||||
enum
|
||||
{
|
||||
VALUE = 1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct TypeWrapper
|
||||
/// Use the type wrapper if you want to dedecouple constness and references from template types
|
||||
|
Loading…
x
Reference in New Issue
Block a user