Skip to content

Instantly share code, notes, and snippets.

@wjwwood
Created December 8, 2016 20:26
Show Gist options
  • Save wjwwood/8b42382d0230c9ec13292b2bc32afa23 to your computer and use it in GitHub Desktop.
Save wjwwood/8b42382d0230c9ec13292b2bc32afa23 to your computer and use it in GitHub Desktop.
#include <chrono>
using std::chrono_literals::operator ""h;
constexpr double operator "" _ping(unsigned long long ping)
{
return double(ping);
}
constexpr double operator "" pong(unsigned long long pong)
{
return double(pong);
}
int main(void) {
auto hour = 3h;
double x = 12_ping;
double y = 13pong;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment