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
task do_a(n: int32): int32 { ... } | |
task do_b(n: int32): int32 { ... } | |
task test(target: Domain): void | |
{ | |
do_a(1); // call do_a | |
do_b(2); // call do_b | |
16: do_a(1); // call do_a with 16 times | |
16: do_b(2); // call do_b with 16 times |
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
thor | |
├── contrib | |
│ ├── bar | |
│ └── foo | |
├── include | |
│ ├── dir-1 | |
│ │ └── hdr-1.h | |
│ └── dir-2 | |
│ └── hdr-2.h | |
├── src |
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 SET_UNION_ITERATOR_RANGE_HPP | |
#define SET_UNION_ITERATOR_RANGE_HPP | |
#include <type_traits> | |
#include <utility> | |
#include <boost/blank.hpp> | |
#include <boost/iterator/iterator_adaptor.hpp> | |
#include <boost/iterator/iterator_categories.hpp> | |
#include <boost/logic/tribool.hpp> |
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 <vector> | |
#include <boost/range/iterator_range.hpp> | |
#include <boost/range/irange.hpp> | |
int main() { | |
std::vector<int> v; | |
auto range_1 = boost::make_iterator_range(v); | |
auto range_2 = boost::irange(0, 1); |
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 <vector> | |
template<typename T> | |
std::function<void(void *)> get_dtor() | |
{ | |
return [](void *p) | |
{ | |
return static_cast<T *>(p)->~T(); | |
}; |
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 <iterator> | |
#include <list> | |
#include <string> | |
#include <type_traits> | |
#include <utility> | |
#include <vector> | |
template<typename container_type, typename transformer_type> | |
auto comprehense(container_type&& c, transformer_type&& t) -> typename std::remove_cv<typename std::remove_reference<container_type>::type>::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> | |
#include <tuple> | |
#include <type_traits> | |
#include <vector> | |
class node_base; | |
template<typename C> | |
std::false_type has_begin_end_eval(...); |
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 ITERATOR_HPP | |
#define ITERATOR_HPP | |
#include <boost/spirit/include/classic_position_iterator.hpp> | |
typedef boost::spirit::classic::position_iterator<std::wstring::const_iterator> iterator_type; | |
#endif /* ITERATOR_HPP */ |
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
// illustrate that user could add functionality on origin functions easily | |
function min_max<T>(v1: T, v2: T ): (T, T); | |
function min_max<T>(v1: T, v2: T, v3: T ): (T, T); | |
function min_max<T>(v1: T, v2: T, v3: T, v4: T): (T, T); | |
function min_max_add<T>(v1: T, v2: T ) { return min_max(v1, v2 ), v1 + v2 ;} | |
function min_max_add<T>(v1: T, v2: T, v3: T ) { return min_max(v1, v2, v3 ), v1 + v2 + v3 ;} | |
function min_max_add<T>(v1: T, v2: T, v3: T, v4: T) { return min_max(v1, v2, v3, v4), v1 + v2 + v3 + v4;} |