Example #1
0
// A value of type T1 can be converted to a type T2 if they are
// similar and... something about the cv-signature.
//
// Note that the top-level cv-qualifiers can be removed by this
// conversion since it applies to values (i.e., copies).
Expr&
convert_qualifier(Expr& e, Type& t)
{
  if (is_similar(e.type(), t)) {
    Qualifier_list sa = get_qualification_signature(e.type());
    Qualifier_list sb = get_qualification_signature(t);
    if (can_convert_signature(sa, sb))
      return *new Qualification_conv(t, e);
  }
  return e;
}
Example #2
0
// Returns the qualification singature of `t`.
Qualifier_list
get_qualification_signature(Type const& t)
{
  Qualifier_list s;
  get_qualification_signature(t, s);
  std::reverse(s.begin(), s.end());  // We built the list backwards
  return s;
}
Example #3
0
// Returns the qualification singature of `t`.
Qualifier_list
get_qualification_signature(Type const& t)
{
  Qualifier_list s;
  get_qualification_signature(t, s);

  // The list is built backwards. Reverse it.
  std::reverse(s.begin(), s.end());

  return s;
}
Example #4
0
 void operator()(Sequence_type const& t)  { get_qualification_signature(t.type(), sig); }
Example #5
0
 void operator()(Pointer_type const& t)   { get_qualification_signature(t.type(), sig); }