Skip to content

Instantly share code, notes, and snippets.

#include <chrono>
#include <cstdint>
#include <istream>
#include <locale>
#include <ostream>
namespace std
{
namespace chrono
{
@HowardHinnant
HowardHinnant / test_file_clock.cpp
Created August 1, 2018 21:40
Example implementation of filesystem::file_clock which covers the range and precision of ext4 (https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout)
#include "date/tz.h"
#include <ostream>
#include <istream>
namespace filesystem
{
struct file_clock
{
using duration = std::chrono::nanoseconds;
#-------------------------------------------------------------------------------
#
# Rippled Server Instance Configuration Example
#
#-------------------------------------------------------------------------------
#
# Contents
#
# 1. Server
#
#ifndef SCOPE
#define SCOPE
#include <exception>
#include <type_traits>
namespace xstd
{
// scope_exit
struct P
{
T* t;
std::atomic<std::uint16_t> n;
template<class DeducedHandler, class... Args>
P(DeducedHandler&& handler, Args&&... args);
private:
P() noexcept;
@HowardHinnant
HowardHinnant / rippled_conversion.cpp
Created June 25, 2016 02:24
Example: Application to convert seconds from 2000-01-01 UTC to and from local America/Los_Angeles time.
// clang++ -std=c++14 rippled_conversion.cpp -o rippled_conversion -I../date ../date/tz.cpp -O3 -lcurl
#include "tz.h" // Requires: http://howardhinnant.github.io/date/tz.html
#include <chrono>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <thread>