Skip to content

Instantly share code, notes, and snippets.

View brycelelbach's full-sized avatar

Bryce Adelstein Lelbach aka wash brycelelbach

  • NVIDIA
  • Sunnyvale, CA
View GitHub Profile
wash@Pegasus:~/sandbox$ clang++ -cc1 -load ~/ariel/build/default/Profiler/libarielProfiler.so -plugin arielProfiler nested_inst.cpp
foo -> 1
bar -> 1
wash@Pegasus:~/sandbox$ cat nested_inst.cpp
template<typename T>
struct bar {
typedef T type;
};
template<typename T>
wash@Pegasus:~/sandbox$ clang++ -cc1 -load ~/ariel/build/default/Profiler/libarielProfiler.so -plugin arielProfiler nested_inst.cpp
foo -> 1
bar -> 1
wash@Pegasus:~/sandbox$ cat nested_inst.cpp
template<typename T>
struct bar {
typedef T type;
};
template<typename T>
wash@Pegasus:~/sandbox/clangtemplate$ cat none.cpp
template<typename T>
struct foo {
typedef T type;
};
int main (void) {
}
wash@Pegasus:~/sandbox$ g++ crtp.cpp -o crtp
wash@Pegasus:~/sandbox$ ./crtp
eat!
sift!
compose!
sift!
compose!
compose!
wash@Pegasus:~/sandbox$ cat crtp.cpp
#include <iostream>
wash@Pegasus:~/nt2/src$ tree
.
`-- nt2
`-- sdk
|-- config
| `-- version.cpp
|-- details
| `-- timestamp.cpp
`-- memory
|-- allocate.cpp
//===- llvm/ADT/scoped_ptr.h - basic smart pointer --------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the scoped_ptr smart pointer: scoped_ptr mimics a built-in
//===- llvm/ADT/OwningPtr.h - Smart ptr that owns the pointee ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines and implements the OwningPtr class.
start %= kwd("help") [eps[help()]]
/ kwd("version") [eps[version()]]
/ kwd("include", 0, 1)['=' > *(include >> -lit(','))]
/ kwd("input", 0, 1) ['=' > input]
;
#include <iostream>
#include <vector>
#include <string>
#include "function_object_adaptor.hpp"
struct base { virtual ~base (void) { } };
struct element: base { };
template<typename Data, typename Function>
struct function_object_adaptor {
public:
typedef typename Function::result_type value_type;
typedef value_type& reference;
typedef value_type* pointer;
private:
Data data;
Function f;