Skip to content

Commit 4a2935e

Browse files
author
svorenova
committed
Doc std_types cont.
1 parent bb8aa52 commit 4a2935e

File tree

2 files changed

+165
-111
lines changed

2 files changed

+165
-111
lines changed

src/util/std_types.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ std::size_t struct_union_typet::component_number(
5353
return 0;
5454
}
5555

56-
/// Get the component with given name.
56+
/// Get the reference to a component with given name.
5757
const struct_union_typet::componentt &struct_union_typet::get_component(
5858
const irep_idt &component_name) const
5959
{
@@ -79,7 +79,10 @@ typet struct_union_typet::component_type(
7979
return c.type();
8080
}
8181

82-
/// Returns true if the object is a prefix of \param other.
82+
/// Returns true if the struct is a prefix of \a other, i.e., if this struct
83+
/// has n components then the component types and names of this struct must
84+
/// match the first n components of \a other struct.
85+
/// \param other Struct type to compare with.
8386
bool struct_typet::is_prefix_of(const struct_typet &other) const
8487
{
8588
const componentst &ot_components=other.components();
@@ -109,12 +112,14 @@ bool struct_typet::is_prefix_of(const struct_typet &other) const
109112
return true; // ok, *this is a prefix of ot
110113
}
111114

115+
/// Returns true if the type is a reference.
112116
bool is_reference(const typet &type)
113117
{
114118
return type.id()==ID_pointer &&
115119
type.get_bool(ID_C_reference);
116120
}
117121

122+
/// Returns if the type is an R value reference.
118123
bool is_rvalue_reference(const typet &type)
119124
{
120125
return type.id()==ID_pointer &&

0 commit comments

Comments
 (0)