@@ -131,14 +131,14 @@ BSLS_IDENT("$Id: $")
131
131
//
132
132
// First, we define the interface of `NullableVector`:
133
133
// ```
134
+ // /// This class implements a sequential container of elements of the
135
+ // /// template parameter `TYPE`.
134
136
// template <class TYPE>
135
137
// class NullableVector {
136
- // // This class implements a sequential container of elements of the
137
- // // template parameter 'TYPE'.
138
138
//
139
139
// // DATA
140
140
// bsl::vector<TYPE> d_values; // data elements
141
- // bdlc::BitArray d_nullFlags; // ' true' indicates i'th element is
141
+ // bdlc::BitArray d_nullFlags; // ` true` indicates i'th element is
142
142
// // null
143
143
//
144
144
// private:
@@ -153,77 +153,80 @@ BSLS_IDENT("$Id: $")
153
153
//
154
154
// public:
155
155
// // CREATORS
156
+ //
157
+ // /// Construct a vector having the specified `initialLength` null
158
+ // /// elements. Optionally specify a `basicAllocator` used to supply
159
+ // /// memory. If `basicAllocator` is 0, the currently supplied
160
+ // /// default allocator is used.
156
161
// explicit
157
162
// NullableVector(bsl::size_t initialLength,
158
163
// bslma::Allocator *basicAllocator = 0);
159
- // // Construct a vector having the specified 'initialLength' null
160
- // // elements. Optionally specify a 'basicAllocator' used to supply
161
- // // memory. If 'basicAllocator' is 0, the currently supplied
162
- // // default allocator is used.
163
164
//
164
165
// // ...
165
166
//
166
167
// ~NullableVector();
167
168
// // Destroy this vector.
168
169
//
169
170
// // MANIPULATORS
171
+ //
172
+ // /// Append a null element to this vector. Note that the appended
173
+ // /// element will have the same value as a default constructed `TYPE`
174
+ // /// object.
170
175
// void appendNullElement();
171
- // // Append a null element to this vector. Note that the appended
172
- // // element will have the same value as a default constructed 'TYPE'
173
- // // object.
174
176
//
177
+ // /// Append an element having the specified `value` to the end of
178
+ // /// this vector.
175
179
// void appendElement(const TYPE& value);
176
- // // Append an element having the specified 'value' to the end of
177
- // // this vector.
178
180
//
181
+ // /// Make the element at the specified `index` in this vector
182
+ // /// non-null. The behavior is undefined unless `index < length()`.
179
183
// void makeNonNull(bsl::size_t index);
180
- // // Make the element at the specified 'index' in this vector
181
- // // non-null. The behavior is undefined unless 'index < length()'.
182
184
//
185
+ // /// Make the element at the specified `index` in this vector null.
186
+ // /// The behavior is undefined unless `index < length()`. Note that
187
+ // /// the new value of the element will be the default constructed
188
+ // /// value for `TYPE`.
183
189
// void makeNull(bsl::size_t index);
184
- // // Make the element at the specified 'index' in this vector null.
185
- // // The behavior is undefined unless 'index < length()'. Note that
186
- // // the new value of the element will be the default constructed
187
- // // value for 'TYPE'.
188
190
//
191
+ // /// Return a reference providing modifiable access to the (valid)
192
+ // /// element at the specified `index` in this vector. The behavior
193
+ // /// is undefined unless `index < length()`. Note that if the
194
+ // /// element at `index` is null then the nullness flag is reset and
195
+ // /// the returned value is the default constructed value for `TYPE`.
189
196
// TYPE& modifiableElement(bsl::size_t index);
190
- // // Return a reference providing modifiable access to the (valid)
191
- // // element at the specified 'index' in this vector. The behavior
192
- // // is undefined unless 'index < length()'. Note that if the
193
- // // element at 'index' is null then the nullness flag is reset and
194
- // // the returned value is the default constructed value for 'TYPE'.
195
197
//
198
+ // /// Remove the element at the specified `index` in this vector. The
199
+ // /// behavior is undefined unless `index < length()`.
196
200
// void removeElement(bsl::size_t index);
197
- // // Remove the element at the specified 'index' in this vector. The
198
- // // behavior is undefined unless 'index < length()'.
199
201
//
200
202
// // ACCESSORS
203
+ //
204
+ // /// Return a reference providing non-modifiable access to the
205
+ // /// element at the specified `index` in this vector. The behavior
206
+ // /// is undefined unless `index < length()`. Note that if the
207
+ // /// element at `index` is null then the nullness flag is not reset
208
+ // /// and the returned value is the default constructed value for
209
+ // /// `TYPE`.
201
210
// const TYPE& constElement(bsl::size_t index) const;
202
- // // Return a reference providing non-modifiable access to the
203
- // // element at the specified 'index' in this vector. The behavior
204
- // // is undefined unless 'index < length()'. Note that if the
205
- // // element at 'index' is null then the nullness flag is not reset
206
- // // and the returned value is the default constructed value for
207
- // // 'TYPE'.
208
211
//
212
+ // /// Return `true` if any element in this vector is non-null, and
213
+ // /// `false` otherwise.
209
214
// bool isAnyElementNonNull() const;
210
- // // Return 'true' if any element in this vector is non-null, and
211
- // // 'false' otherwise.
212
215
//
216
+ // /// Return `true` if any element in this vector is null, and `false`
217
+ // /// otherwise.
213
218
// bool isAnyElementNull() const;
214
- // // Return 'true' if any element in this vector is null, and 'false'
215
- // // otherwise.
216
219
//
220
+ // /// Return `true` if the element at the specified `index` in this
221
+ // /// vector is null, and `false` otherwise. The behavior is
222
+ // /// undefined unless `index < length()`.
217
223
// bool isElementNull(bsl::size_t index) const;
218
- // // Return 'true' if the element at the specified 'index' in this
219
- // // vector is null, and 'false' otherwise. The behavior is
220
- // // undefined unless 'index < length()'.
221
224
//
225
+ // /// Return the number of elements in this vector.
222
226
// bsl::size_t length() const;
223
- // // Return the number of elements in this vector.
224
227
//
228
+ // /// Return the number of null elements in this vector.
225
229
// bsl::size_t numNullElements() const;
226
- // // Return the number of null elements in this vector.
227
230
// };
228
231
// ```
229
232
// Then, we implement, in turn, each of the methods declared above:
0 commit comments