MCPcopy Create free account
hub / github.com/MyGUI/mygui / median3

Function median3

Tools/EditorFramework/pugixml.cpp:6247–6255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6245
6246template<typename I, typename Pred>
6247void median3(I first, I middle, I last, const Pred& pred)
6248{
6249 if (pred(*middle, *first))
6250 swap(*middle, *first);
6251 if (pred(*last, *middle))
6252 swap(*last, *middle);
6253 if (pred(*middle, *first))
6254 swap(*middle, *first);
6255}
6256
6257template<typename I, typename Pred>
6258void median(I first, I middle, I last, const Pred& pred)

Callers 1

medianFunction · 0.70

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected