git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56848
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class VariableSetterImpl : public VariableSetterBase
{
public:
class VariableSetterImpl : public VariableSetterBase
{
public:
- VariableSetterImpl(T& var, const U& value)
+ VariableSetterImpl(T& var, U value)
: m_var(var),
m_value(value)
{
: m_var(var),
m_value(value)
{
// suppress the warning about assignment operator not being generated
VariableSetterImpl<T, U>& operator=(const VariableSetterImpl<T, U>&);
// suppress the warning about assignment operator not being generated
VariableSetterImpl<T, U>& operator=(const VariableSetterImpl<T, U>&);
template <typename T, typename U>
inline
template <typename T, typename U>
inline
-wxPrivate::VariableSetterImpl<T, U> wxMakeVarSetter(T& var, const U& value)
+wxPrivate::VariableSetterImpl<T, U> wxMakeVarSetter(T& var, U value)
{
return wxPrivate::VariableSetterImpl<T, U>(var, value);
}
{
return wxPrivate::VariableSetterImpl<T, U>(var, value);
}
+ Notice that @a value is copied, i.e. stored by value, so it can be a
+ temporary object returned by a function call, for example.
+
@see wxON_BLOCK_EXIT_OBJ0(), wxON_BLOCK_EXIT_NULL()
@header{wx/scopeguard.h}
@see wxON_BLOCK_EXIT_OBJ0(), wxON_BLOCK_EXIT_NULL()
@header{wx/scopeguard.h}