store the value to be set inside wxON_BLOCK_EXIT_SET(), this allows to use temporaries with it and also fixes the test failure when built with icc and optimizations on (not sure if it is a compiler bug or not but in any case it seems better to fix it)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-19 12:06:17 +00:00
parent a779d8091c
commit e196e5232a
2 changed files with 6 additions and 3 deletions

View File

@@ -411,7 +411,7 @@ template <typename T, typename U>
class VariableSetterImpl : public VariableSetterBase
{
public:
VariableSetterImpl(T& var, const U& value)
VariableSetterImpl(T& var, U value)
: m_var(var),
m_value(value)
{
@@ -424,7 +424,7 @@ public:
private:
T& m_var;
const U& m_value;
const U m_value;
// suppress the warning about assignment operator not being generated
VariableSetterImpl<T, U>& operator=(const VariableSetterImpl<T, U>&);
@@ -454,7 +454,7 @@ private:
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);
}