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 "interfaceptr.hpp" | |
#include <cassert> | |
struct Interface1 {}; | |
struct Interface2 {}; | |
struct Interface3 {}; | |
struct Class1 : Interface1, Interface2 {}; | |
struct Class2 : Interface2, Interface3 {}; |
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> | |
using namespace std; | |
#define JOIN(a, b) JOIN_(a, b) | |
#define JOIN_(a, b) a ## b | |
#define ARG_COUNT(...) ARG_COUNT_IMP(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1) | |
#define ARG_COUNT_IMP( _1,_2,_3,_4,_5,_6,_7,_8,_9, N, ...) N |
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 <exception> | |
#include <iostream> | |
namespace inject | |
{ | |
struct bad_weak_ptr : std::exception | |
{ | |
virtual char const * what() const _GLIBCXX_USE_NOEXCEPT | |
{ |
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 <boost/iostreams/stream_buffer.hpp> | |
#include <boost/iostreams/device/null.hpp> | |
#include <iostream> | |
namespace io = boost::iostreams; | |
int main() | |
{ | |
io::stream_buffer<io::null_sink> null_buf{io::null_sink()}; | |
std::cout.rdbuf(&null_buf); |
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
<html> | |
<head> | |
<title>CoffeeScript charts</title> | |
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("visualization", "1", {packages:["corechart"]}); | |
google.load("visualization", "1", {packages:["table"]}); | |
</script> |
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
diff -u -r a/CRT.c b/CRT.c | |
--- a/CRT.c 2012-10-19 14:59:28.000000000 -0400 | |
+++ b/CRT.c 2013-01-28 12:08:36.812929000 -0500 | |
@@ -562,7 +562,7 @@ | |
CRT_colors[LED_COLOR] = ColorPair(Green,Black); | |
CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black); | |
CRT_colors[PROCESS] = A_NORMAL; | |
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black); | |
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Green,Black); | |
CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black); |
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 <type_traits> | |
template<typename F, typename ...Ts> | |
class is_callable | |
{ | |
template<typename G, typename ...Us> | |
static | |
decltype( | |
typename std::add_pointer<decltype(std::declval<G>()(std::declval<Us>()...))>::type{}, | |
std::true_type{}) |
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> | |
template <typename ...Funcs> | |
struct overload_set; | |
template <typename Head, typename ...Tail> | |
struct overload_set<Head, Tail...> : Head, overload_set<Tail...> | |
{ | |
overload_set(Head head, Tail... tail) | |
: Head{head} |
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
testing: by value | |
* lvalue | |
lvalue: cctor | |
lvalue: mctor | |
* xvalue | |
xvalue: mctor | |
xvalue: mctor | |
* rvalue | |
rvalue: mctor | |
* done |
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
// C++11 has thread-safe function local statics, but this code is just | |
// to illustrate how one would do a thread-safe one-time initialization | |
// using atomic variables. | |
#include <atomic> | |
#include <thread> | |
#include <cassert> | |
#include <vector> | |
using namespace std; |