From 704a26af70a720c02c71c96d313045204bca8f9f Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Wed, 7 Aug 2019 15:46:41 +0200 Subject: [PATCH] WIP --- sample/api.cpp | 69 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/sample/api.cpp b/sample/api.cpp index b16c6f8ff..eff05049a 100644 --- a/sample/api.cpp +++ b/sample/api.cpp @@ -2,43 +2,44 @@ #include #include +#include "TimeHelper.h" +#include "ToString.h" +// std::ostream &operator<<(std::ostream &os, const std::chrono::nanoseconds &t) { +// os << t.count() << "ns"; +// return os; +// } -std::ostream &operator<<(std::ostream &os, const std::chrono::nanoseconds &t) { - os << t.count() << "ns"; - return os; -} +// template +// struct is_container : std::false_type {}; -template -struct is_container : std::false_type {}; +// template struct is_container_helper {}; -template struct is_container_helper {}; +// template +// struct is_container< +// T, typename std::conditional< +// false, +// is_container_helper().size()), +// decltype(std::declval().begin()), +// decltype(std::declval().end()), +// decltype(std::declval().cbegin()), +// decltype(std::declval().cend()), +// decltype(std::declval().empty())>, +// void>::type> : public std::true_type {}; -template -struct is_container< - T, typename std::conditional< - false, - is_container_helper().size()), - decltype(std::declval().begin()), - decltype(std::declval().end()), - decltype(std::declval().cbegin()), - decltype(std::declval().cend()), - decltype(std::declval().empty())>, - void>::type> : public std::true_type {}; - -template -auto operator<<(std::ostream &os, const Container &con) -> - typename std::enable_if::value, - std::ostream &>::type { - if (con.empty()) - return os << "[]"; - auto it = con.cbegin(); - os << '[' << *it++; - while (it != con.cend()) - os << ", " << *it++; - return os << ']'; -} +// template +// auto operator<<(std::ostream &os, const Container &con) -> +// typename std::enable_if::value, +// std::ostream &>::type { +// if (con.empty()) +// return os << "[]"; +// auto it = con.cbegin(); +// os << '[' << *it++; +// while (it != con.cend()) +// os << ", " << *it++; +// return os << ']'; +// } using sls::Detector; using std::chrono::nanoseconds; @@ -57,7 +58,7 @@ int main() { // std::cout << "exptime: " <