Skip to content

Commit

Permalink
Fixed conversion_use_type<>(T const&, indicator&) constructor.
Browse files Browse the repository at this point in the history
This constructor could never compile as it lacked the const_cast<> needed to
assign its const parameter to non-const member reference. It also didn't set
readOnly_ member to true correctly.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
  • Loading branch information
vadz committed Jul 10, 2012
1 parent c3c4209 commit e1c04c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/type-conversion.h
Expand Up @@ -111,9 +111,9 @@ class conversion_use_type
conversion_use_type(T const & value, indicator & ind,
std::string const & name = std::string())
: use_type<base_type>(details::base_value_holder<T>::val_, ind, name)
, value_(value)
, value_(const_cast<T &>(value))
, ind_(ind)
, readOnly_(false)
, readOnly_(true)
{
//convert_to_base();
}
Expand Down

0 comments on commit e1c04c8

Please sign in to comment.