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

Function exchange

dlib/algs.h:361–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359 typename T
360 >
361 void exchange (
362 T& a,
363 T& b
364 )
365 /*!
366 This function does the exact same thing that global swap does and it does it by
367 just calling swap. But a lot of compilers have problems doing a Koenig Lookup
368 and the fact that this has a different name (global swap has the same name as
369 the member functions called swap) makes them compile right.
370
371 So this is a workaround but not too ugly of one. But hopefully I can get
372 rid of this in a few years. So this function is already deprecated.
373
374 This also means you should NOT use this function in your own code unless
375 you have to support an old buggy compiler that benefits from this hack.
376 !*/
377 {
378 using std::swap;
379 using dlib::swap;
380 swap(a,b);
381 }
382
383// ----------------------------------------------------------------------------------------
384

Callers 15

qsort_partitionFunction · 0.85
heapifyFunction · 0.85
isort_arrayFunction · 0.85
hsort_arrayFunction · 0.85
scope_exitMethod · 0.85
addMethod · 0.85
swapMethod · 0.85
av_dictMethod · 0.85
ffmpeg_details.hFile · 0.85
openMethod · 0.85
swapMethod · 0.85
swapMethod · 0.85

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected