This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.mm | |
// foo2 | |
// | |
// Created by Richard Hodges on 21/09/2016. | |
// Copyright © 2016 Richard Hodges. All rights reserved. | |
// | |
#include <vector> | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
struct IO | |
{ | |
std::istream& input; | |
std::ostream& output; | |
std::ostream& error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for exposition - a custom variant might be better | |
#include <variant> | |
#include <tuple> | |
// some library constructs | |
namespace compose | |
{ | |
struct continue_op_t { | |
}; | |
constexpr auto continue_op = continue_op_t {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto stream = http::request_stream(); | |
co_await stream.async_connect(url, http::get); | |
auto&& header = stream.header(); | |
std::string store; | |
auto bytes = | |
co_await net::async_read(stream, net::dynamic_buffer(store)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template< | |
class Stream, class DynamicBuffer, | |
class ParserType> | |
struct read_msg_op | |
: public asio::coroutine | |
, public enable_stable_storage | |
{ | |
using parser_type = ParserType; | |
using message_type = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> struct identity {}; | |
template < class... Ts > | |
struct for_all_types_impl; | |
template <> | |
struct for_all_types_impl<> | |
{ | |
template<class...Args> | |
bool operator()(Args&&...) const { return false; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template < class NextLayer > | |
struct server_accept_op : server_accept_op_base | |
{ | |
using stream_type = stream< NextLayer >; | |
server_accept_op(stream_type &stream, server_accept_state &state) | |
: server_accept_op_base(state) | |
, stream(stream) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string_view> | |
// DEPENDENCY: ORDER wise_enum after string_view | |
#include "wise_enum/wise_enum.h" | |
#include <fmt/format.h> | |
#include <string> | |
#include <type_traits> | |
namespace config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(NOT REQUIRE_BOOST_CMAKE) | |
set(REQUIRE_BOOST_CMAKE 1) | |
else() | |
return() | |
endif() | |
function(ListToString list outstr) | |
set(result) | |
foreach(item IN LISTS "${list}") | |
message(STATUS "--${item}") |
OlderNewer