diff options
Diffstat (limited to 'odb/inline.cxx')
-rw-r--r-- | odb/inline.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/odb/inline.cxx b/odb/inline.cxx index 612219f..6cbb3cc 100644 --- a/odb/inline.cxx +++ b/odb/inline.cxx @@ -24,15 +24,25 @@ namespace if (transient (m)) return; + semantics::type& t (m.type ()); + string const& name (public_name (m)); - string const& type (m.type ().fq_name (m.belongs ().hint ())); + + semantics::names* hint; + semantics::type& ut (utype (m, hint)); + string const& type (ut.fq_name (hint)); os << "inline" << endl << type << "& " << scope_ << "::" << endl << name << " (value_type& v)" - << "{" - << "return v." << m.name () << ";" - << "}"; + << "{"; + + if (const_type (t)) + os << "return const_cast< " << type << "& > (v." << m.name () << ");"; + else + os << "return v." << m.name () << ";"; + + os << "}"; os << "inline" << endl << "const " << type << "& " << scope_ << "::" << endl |