This file contains 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> | |
#include <string> | |
#include <utility> | |
#include <boost/format.hpp> | |
template<typename T> | |
boost::format& apply_format_args(boost::format& form, T&& t) | |
{ | |
return form % std::forward<T>(t); | |
} |
This file contains 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
/* | |
* File: Signal.js | |
* Classes: Signal, Signal.Connection | |
* Author: Sean Cline | |
* Version: .1 | |
* Description: A minimal Signal class that lets you connect and disconnect handlers to be called when .emit(...) is called. | |
* License: You may do whatever you please with this file and any code it contains. It is public domain. | |
* Usage: | |
* let sig = new Signal(); | |
* let connection1 = sig.connect(function(str) { alert(str + "1") }); |
This file contains 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> | |
#include <string> | |
#include <filesystem> | |
#include <vector> | |
#include <algorithm> | |
#include <exception> | |
using namespace std; | |
using namespace std::tr2::sys; |
This file contains 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 <stdexcept> | |
#include <iostream> | |
#include <chrono> | |
using namespace std; | |
using namespace std::chrono; | |
typedef long long number; | |
typedef int count_type; |
This file contains 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
#pragma once | |
#include <memory> | |
#include <utility> | |
#include <cassert> | |
template <typename T> | |
class cow_ptr | |
{ | |
public: |
This file contains 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
#pragma once | |
#include <memory> | |
#include <utility> | |
#include <type_traits> | |
#include <functional> // TODO: Stop using functional. | |
template <class T> | |
struct default_clone { | |
T* operator()(const T* ptr) const |
This file contains 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 "transacted.h" | |
#include <iostream> | |
#include <stdexcept> | |
using namespace std; | |
int x = 1; | |
long y = 2; | |
float z = 3; | |
void doSomething() |
This file contains 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
#pragma once | |
#include <string> | |
#include <codecvt> | |
Platform::String^ to_PlatformString(const char* from) | |
{ | |
std::wstring_convert<std::codecvt<wchar_t, char, mbstate_t>> convert; | |
auto wide = convert.from_bytes(from); | |
return ref new Platform::String(wide.c_str(), static_cast<unsigned int>(wide.size())); |
This file contains 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
#pragma once | |
#include <string> | |
// Why can't MFC and ATL just get along? | |
#if defined(_AFX) || defined(_AFXDLL) | |
# include <cstringt.h> | |
#else | |
# include <atlstr.h> | |
#endif |
This file contains 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
#pragma once | |
#include <iostream> | |
#include <deque> | |
#include <vector> | |
struct hrm_num { | |
static int validate(int n) | |
{ | |
if (n < -999 || n > 999) |
OlderNewer