MCPcopy Create free account
hub / github.com/davisking/dlib / set_difference

Function set_difference

dlib/set_utils/set_utils.h:197–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195 typename V
196 >
197 void set_difference (
198 const T& a,
199 const U& b,
200 V& d
201 )
202 {
203 typedef typename T::type type;
204 if (is_same_object(a,d) || is_same_object(b,d))
205 {
206 V local_d;
207
208 type temp;
209
210 a.reset();
211 while (a.move_next())
212 {
213 if (b.is_member(a.element()) == false)
214 {
215 temp = a.element();
216 local_d.add(temp);
217 }
218 }
219
220 local_d.swap(d);
221 }
222 else
223 {
224 d.clear();
225 type temp;
226
227 a.reset();
228 while (a.move_next())
229 {
230 if (b.is_member(a.element()) == false)
231 {
232 temp = a.element();
233 d.add(temp);
234 }
235 }
236 }
237 }
238
239// ----------------------------------------------------------------------------------------
240

Callers

nothing calls this directly

Calls 6

is_same_objectFunction · 0.50
resetMethod · 0.45
move_nextMethod · 0.45
addMethod · 0.45
swapMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected