Skip to content

Instantly share code, notes, and snippets.

View Cryolite's full-sized avatar

Cryolite Cryolite

View GitHub Profile
#include <functional>
#include <iostream>
class C
{
public:
C() : i_() {}
std::function<void(int)> set = [this](int i) mutable { this->i_ = i; };
std::function<int()> get = [this]() { return this->i_; };
#include <iostream>
struct S
{
S(int i) : i_(i) {}
S(S const &) = delete;
S(S &&) = delete;
void double_() { i_ *= 2; }
int get() const { return i_; }
#include <type_traits>
void f(std::integral_constant<int, 0>);
template<int I>
auto f(std::integral_constant<int, I>)
-> decltype(f(std::integral_constant<int, I - 1>()));
int main()
{
// [conv.lval]/1
// A glvalue (3.10) of a non-function, non-array type T can be converted to
// a prvalue. If T is an incomplete type, a program that necessitates this
// conversion is ill-formed. ...
//
// [expr.cond]/3, /5 and /6
//
// Note: [class.conv.fct] does not require the type specified in
// conversion-type-id of conversion-function-id should be complete.
struct B
{};
struct D
: private B
{};
template<typename T>
T &&declval();
@Cryolite
Cryolite / gist:3269831
Created August 6, 2012 03:44
A test case for nanahan::Map
#include <map/map.hpp>
#include <boost/functional/hash.hpp>
#include <boost/unordered_map.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_smallint.hpp>
#include <boost/random/uniform_real.hpp>
#include <ext/throw_allocator.h>
#include <cstddef>
#include <ctime>
#include <utility>

We Are Soliciting Private and Company Sponsors

Wandbox is an online service with which source code snippets in many programming languages compile and run.
This service has been made and maintained by @melponn and @kikairoya.

Currently, it is running on three Sakura VPS 2G Plan servers. It takes JPY56,310 a year as the running cost.

It is a hard way to cope with the operating expenses by ourselves.
Therefore, we are soliciting private and company sponsors who support Wandbox.
We ask for cooperation from individuals and companies who usually use Wandbox.

observer = startObservingAsynchronousEvent(timeout=one_minute);
while (true) {
if (observer.eventOccurs()) break;
if (observer.eventOccursOrTimeout()) {
// if (observer.eventOccurs()) break;
throw TimeoutException();
}
sleep(one_second);
}
@Cryolite
Cryolite / network1.txt
Created September 24, 2018 02:55
ネットワーク構成
The Internet
~~~~~~~~~~~~
|
|
|
|LAN2
+--------------------------+
| Router B (YAMAHA RTX810) |
+--------------------------+
|LAN1
@Cryolite
Cryolite / config.txt
Created September 24, 2018 03:37
ルータ B の IP マスカレイド適用時における DF ビットの扱いの設定
# nat descriptor masquerade remove df-bit off