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 <type_traits> | |
| #include <iostream> | |
| enum class MemberAccess { kProtected, kPublic }; | |
| #define GENERATE_MEMBER_ACCESSOR(...) \ | |
| template < class, AccessRequirement > \ |
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> | |
| #include <iostream> | |
| // The general idea is stollen from here: | |
| // https://stackoverflow.com/questions/44229676/how-to-decide-if-a-template-specialization-exist | |
| template< class T > | |
| struct FunSig; |
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> | |
| #include <memory> | |
| #include <string_view> | |
| #if defined (__clang__) || defined (__GNUG__) | |
| template<class TString> | |
| constexpr auto FindTypeNameBegin (TString&& i_str) { | |
| int index = 0; |
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
| // A compile-time method for checking the existence of a class member | |
| // @see https://general-purpose.io/2017/03/10/checking-the-existence-of-a-cpp-class-member-at-compile-time/ | |
| // This code uses "decltype" which, according to http://en.cppreference.com/w/cpp/compiler_support | |
| // should be supported by Clang 2.9+, GCC 4.3+ and MSVC 2010+ (if you have an older compiler, please upgrade :) | |
| // As of "constexpr", if not supported by your compiler, you could try "const" | |
| // or use the value as an inner enum value e.g. enum { value = ... } | |
| // check "test_has_member.cpp" for a usage example |
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 <functional> | |
| #include <iostream> | |
| template < class Payload, class ActualPayload = Payload > | |
| class PostMortemCollectible { | |
| public: | |
| struct GetPayloadRawPtr { | |
| static ActualPayload *GetPayloadPtr (const Payload &i_payload) { | |
| return &i_payload; |
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
| var app = require('express')(); | |
| var GridStore = require('mongodb').GridStore; | |
| var ObjectID = require('mongodb').ObjectID; | |
| var MongoClient = require('mongodb').MongoClient; | |
| var Server = require('mongodb').Server; | |
| var dbConnection; | |
| MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
| dbConnection = db; | |
| app.listen(3000); |
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 "PropertiesEditorsBinding.h" | |
| #include <QCheckBox> | |
| #include <QHash> | |
| #include <QLineEdit> | |
| #include <QMap> | |
| #include <QMetaObject> | |
| #include <QMetaProperty> | |
| #include <QObject> | |
| #include <QRegularExpression> |
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
| // Bresenham3D | |
| // | |
| // A slightly modified version of the source found at | |
| // http://www.ict.griffith.edu.au/anthony/info/graphics/bresenham.procs | |
| // Provided by Anthony Thyssen, though he does not take credit for the original implementation | |
| // | |
| // It is highly likely that the original Author was Bob Pendelton, as referenced here | |
| // | |
| // ftp://ftp.isc.org/pub/usenet/comp.sources.unix/volume26/line3d | |
| // |