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
| template <typename S, typename T, typename F, S Init, T ...Values> | |
| struct Fold { | |
| template <T Car, T ...Cdr> | |
| struct Fold1 { | |
| constexpr static S Init_ = F::template Result<Init, Car>::Value; | |
| constexpr static S Value = Fold<S, T, F, Init_, Cdr...>::Value; | |
| }; | |
| constexpr static S Value = Fold1<Values...>::Value; | |
| }; |
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 <cstddef> | |
| using namespace std; | |
| template <size_t N, typename Car, typename Cdr> | |
| struct Nth { | |
| static_assert(N > 0, "Index out of range."); | |
| using Type = typename Cdr::template Nth<N - 1>::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 <algorithm> | |
| #include <cerrno> | |
| #include <cstring> | |
| #include <memory> | |
| #include <queue> | |
| #include <stdexcept> | |
| #include "coro.h" | |
| class Coro { |
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> | |
| #include "Poco/Delegate.h" | |
| #include "Poco/DirectoryWatcher.h" | |
| #include "Poco/Event.h" | |
| #include "Poco/Exception.h" | |
| #include "Poco/File.h" | |
| #include "Poco/Mutex.h" |
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
| #!/usr/bin/env perl | |
| use v5.22; | |
| use strict; | |
| use warnings; | |
| use Carp (); | |
| use Data::Dumper; | |
| use List::Util qw/first/; | |
| use PadWalker qw/peek_my peek_our/; |
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
| package ConcurrentFetcher; | |
| use strict; | |
| use warnings; | |
| use AE; | |
| use AnyEvent::HTTP::Request; | |
| use AnyEvent::HTTP::Response; | |
| use Scope::Guard; | |
| use Smart::Args; |
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
| #!/usr/bin/env perl | |
| use feature qw/say/; | |
| use strict; | |
| use warnings; | |
| sub say_context { | |
| my $wantarray = wantarray; | |
| say do { | |
| if ($wantarray) { 'list' } |
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
| #ifndef FLIPFLIOP_H__ | |
| #define FLIPFLIOP_H__ | |
| #include <functional> | |
| #include <utility> | |
| namespace flipflop { | |
| template <typename Value> | |
| class FlipFlop { |
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
| #!/usr/bin/env perl6 | |
| # cf. http://pmthium.com/2014/10/apw2014/ | |
| # "List assignment and the [ ] array constructor are unchanged; they continue | |
| # to flatten their input elements. (Arrays are naturally flat.)" | |
| my ($a, $b, $c) = 1, (2, 3), (4, 5, 6); | |
| .say for $a, $b, $c; # 1, 2, 3 | |
| my $ary = [1, (2, 3), (4, 5, 6)]; |
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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use opts; | |
| use AnyEvent; | |
| use AnyEvent::Twitter; | |
| use Coro; | |
| use Coro::Channel; |