I can never remember how to download the ETCSL corpus, because it’s hosted on the the Oxford Text Archive (DOI: 20.500.12024/2518). Here are the instructions to download a local copy to the current directory.
I hereby claim:
- I am pniedzielski on github.
- I am pniedzielski (https://keybase.io/pniedzielski) on keybase.
- I have a public key whose fingerprint is A66F 5099 CC43 0B02 5B53 D0B9 7F2A 9552 DEBF A176
To claim this, I am signing this object:
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
// Say we want something that generates a T when it is called with | |
// operator(): | |
template <typename G, typename T> | |
concept bool Generator = requires (G g) { | |
{ g() } -> T | |
}; | |
// For instance, this is a Generator of int | |
int gimmeRandomInt() { return rand(); } |
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
// Transcribed (with simple modifications and added comments) from _Fundamentals of Type-Dependent Code Reuse in C++_ presentation by Mark Isaacson at NDC 2015 | |
template <typename T, template <typename> class... Mixins> | |
struct Mixer : public Mixins< Mixer<T, Mixins...> >... { | |
// N4477 Operator Dot (R2), on track for C++17 | |
T& operator.() { return value; } | |
private: | |
T value; | |
}; | |
template <typename 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
/* We have three ways of importing the literals in something designed | |
like the standard library: */ | |
void my_function() { | |
/* Means "now all of foo is the most important thing in this | |
function" -> implies shift from what was most important outside | |
this function */ | |
using namespace foo; | |
// OR | |
/* Means "now the user-defined literals from foo are important" -> | |
implies everything else is like outer scope |