[ create a new paste ] login | about

DigitalGhost

Name:
Email:
Site/Blog:
Location:
Default language: C++
Favorite languages:
About:

Saved pastes by DigitalGhost:

C++, pasted on Jan 1:
1
2
3
4
5
#include <iostream>
#include <boost/preprocessor/cat.hpp>

#define PP_ADD_C(x, y) PP_ADD_C_I(x, y)
#define PP_ADD_C_I(x, y) \
...
view (47 lines, 1 line of output)
C++, pasted on Jul 3:
1
2
3
4
5
#include <iostream>
#include <boost/config.hpp>

int main() {
    std::cout << BOOST_COMPILER << '\n';
...
view (7 lines, 2 lines of output)
C++, pasted on Jul 3:
1
2
3
4
5
#include <iostream>

#define implies || implies_impl ? true :

struct implies_impl_t {
...
view (23 lines, 8 lines of output)
C++, pasted on Jul 2:
1
2
3
4
5
#include <iostream>

#define implies ->* implies_impl ? true :

struct implies_impl_t {
...
view (19 lines, 4 lines of output)
C++, pasted on Feb 12:
1
2
3
4
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/assert.hpp>
...
view (20 lines)
C++, pasted on Jan 14:
1
2
3
4
5
#include <iostream>

struct foo {
  bool get() const { return b; }
  typedef bool (foo::* bool_type)() const;
...
view (17 lines, 2 lines of output)
C++, pasted on Jan 1:
1
2
3
4
5
#include <iostream>
#include <functional>

struct int_adder {
    typedef int first_argument_type;
...
view (13 lines, 1 line of output)
C++, pasted on Dec 29:
1
2
3
4
5
class foo {
  friend int lvalue_only(foo &);
  int f() const {
    return 1;
  }
...
view (16 lines, 3 lines of output, 2 comments)
C++, pasted on Dec 29:
1
2
3
4
class foo {
  friend int lvalue_only(foo &);
  int f() const {
    return 1;
...
view (17 lines, 3 lines of output)
C++, pasted on Dec 21:
1
2
3
4
#include <iostream>
#include <boost/lambda/lambda.hpp>

namespace bll = boost::lambda;
...
view (8 lines, 1 line of output)
C++, pasted on Nov 16:
1
2
3
4
5
#include <iostream>

#include <boost/preprocessor/arithmetic/mod.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/expr_iif.hpp>
...
view (24 lines, 1 line of output)
C++, pasted on Nov 9:
1
2
3
4
// g++-4.3.3 -std=c++0x -E -P

#define PP_IS_EMPTY(...) PP_IS_EMPTY_I(__VA_ARGS__, NIL)
#define PP_IS_EMPTY_I(a, ...) PP_IS_EMPTY_II((HELPER_I a, HELPER_I __VA_ARGS__))
...
view (34 lines)
C++, pasted on Oct 9:
1
2
3
4
5
struct hoge {
  int value;
};
struct hige {
  hoge value;
...
view (11 lines)
C++, pasted on Sep 30:
1
2
3
4
5
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/size.hpp>

#include <boost/preprocessor/stringize.hpp>
...
view (15 lines, 1 line of output)
C++, pasted on Sep 8:
1
2
3
4
5
#include <iostream>

using std::cout;

namespace ns1 {
...
view (93 lines, 14 lines of output)
C++, pasted on Sep 8:
1
2
3
4
5
#include <iostream>

int main() {
  std::cout << __VERSION__ << '\n';
}
view (5 lines, 1 line of output)
C++, pasted on Sep 3:
1
2
3
4
5
#include <iostream>

#define PP_AUTO_REC(p) PP_LOOKUP_UNEXPANDED_1(p)
#define PP_LOOKUP_UNEXPANDED_1(p) PP_IF(p(1), 1 PP_EAT, PP_LOOKUP_UNEXPANDED_2)(p)
#define PP_LOOKUP_UNEXPANDED_2(p) PP_IF(p(2), 2 PP_EAT, PP_LOOKUP_UNEXPANDED_3)(p)
...
view (43 lines, 1 line of output)
C++, pasted on Sep 3:
1
2
3
4
5
#include <iostream>

#define PP_IF(c, t, f) PP_IF_I(c, t, f)
#define PP_IF_I(c, t, f) PP_IF_ ## c(t, f)
#define PP_IF_0(t, f) f
...
view (40 lines, 1 line of output)
C++, pasted on Sep 3:
1
2
3
4
5
namespace ns {
  template<typename T> void f(T const &) {}
}

namespace ns2 {
...
view (31 lines)
C++, pasted on Aug 26:
1
2
3
4
5
#include <iostream>

#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
...
view (36 lines, 2 lines of output)
C++, pasted on Aug 24:
1
2
3
4
#include <iostream>

#define LET(var) [&] { var IN
#define IN(body) return body; }()
...
view (29 lines, 3 lines of output)