based

Opinionated utility library
git clone git://git.dimitrijedobrota.com/based.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

algorithm.cpp (913B)


0 #include "based/algorithm.hpp" 1 2 #include "based/instrumentation.hpp" 3 4 int main() 5 { 6 static constexpr std::size_t size = 16; 7 static constexpr std::size_t mega = 1024; 8 9 { 10 const based::timer time; 11 12 based::count_operations( 13 size, 14 size * mega * mega, 15 [](const auto& a, const auto& b) 16 { 17 based::min_element(a, b); 18 }, 19 based::normalize_n 20 ); 21 } 22 23 { 24 const based::timer time; 25 26 based::count_operations( 27 size, 28 size * mega * mega, 29 [](const auto& a, const auto& b) 30 { 31 based::max_element(a, b); 32 }, 33 based::normalize_n 34 ); 35 } 36 37 { 38 const based::timer time; 39 40 based::count_operations( 41 size, 42 size * mega * mega, 43 [](const auto& a, const auto& b) 44 { 45 based::minmax_element(a, b); 46 }, 47 based::normalize_n 48 ); 49 } 50 51 return 0; 52 }