Skip to content

Instantly share code, notes, and snippets.

View Cryolite's full-sized avatar

Cryolite Cryolite

View GitHub Profile

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.

@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>
struct B
{};
struct D
: private B
{};
template<typename T>
T &&declval();
// [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.
#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()
{
#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 <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_; };