This file contains hidden or 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 <memory> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
template< typename T > | |
class protected_ptr | |
{ | |
shared_ptr<T> m_object; |
This file contains hidden or 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
Источник: https://eao197.blogspot.com/2023/03/progc-taggedvaluet.html | |
Компилятор clang 14.0.6. | |
Объемная версия на базе SFINAE: | |
----- | |
$ clang++-14 -std=c++17 -pedantic -Wall -o t1_clang14 t1.cpp | |
t1.cpp:198:24: error: overload resolution selected deleted operator '<' | |
const auto cr = (bin1 < bin2); |
This file contains hidden or 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 <chrono> | |
#include <vector> | |
#include <so_5/all.hpp> | |
using hires_clock = std::chrono::high_resolution_clock; | |
struct msg_01 final : public so_5::signal_t {}; | |
struct msg_02 final : public so_5::signal_t {}; |
This file contains hidden or 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 defined( "UNIX" ) && !defined( "GNU" ) | |
define "GNU"; | |
objPath = "o"; | |
if !defined( "NOAUTODEP" ) { | |
autodepIncludePathList += "."; | |
autodepIncludePathList += "h"; | |
autodepIncludePathList += "mxx/h"; | |
} |
This file contains hidden or 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
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN | |
#include <doctest/doctest.h> | |
#include <restinio/helpers/http_field_parsers/host.hpp> | |
namespace example | |
{ | |
namespace ep = restinio::easy_parser; |
This file contains hidden or 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 <so_5/all.hpp> | |
struct m1 final : public so_5::signal_t {}; | |
struct m2 final : public so_5::signal_t {}; | |
struct m3 final : public so_5::signal_t {}; | |
struct done final : public so_5::signal_t {}; | |
class A final : public so_5::agent_t | |
{ | |
public: |
This file contains hidden or 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 <chrono> | |
#include <iostream> | |
#include <string> | |
#include <variant> | |
namespace isdefault_benchmark | |
{ | |
class time_meter_t | |
{ |
This file contains hidden or 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
class meeting_room_t { | |
std::mutex lock_; | |
std::condition_variable wakeup_cv_; | |
unsigned attenders_{}; | |
public: | |
meeting_room_t() = default; | |
void enter() { |
This file contains hidden or 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 <so_5/all.hpp> | |
#include <iostream> | |
class shutdown_initiated final : public so_5::signal_t {}; | |
class my_stop_guard final : public so_5::stop_guard_t | |
{ | |
const so_5::mbox_t m_dest; |