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
template <typename... Args> | |
class tuple; | |
template <int Index, typename Tuple> | |
struct tuple_element; | |
template <int N, typename... Args> | |
typename tuple_element<N, tuple<Args...>>::type& get(tuple<Args...>& t); | |
template <typename Head, typename... Tails> |
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
<debug> | |
<filename>debug.log</filename> | |
<modules> | |
<module>Finance</module> | |
<module>Admin</module> | |
<module>HR</module> | |
</modules> | |
<level>2</level> | |
</debug> |
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> | |
void hello() | |
{ | |
std::cout << "Hello "; | |
} | |
struct World | |
{ | |
void operator()() |
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 <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <fstream> | |
#include <regex> | |
#include <string> | |
#include <vector> | |
#include <boost/optional.hpp> | |
using namespace std; |
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 <chrono> | |
#include <utility> | |
template <class F, class ...Args> | |
std::chrono::system_clock::duration take_time(F&& f, Args&&... args) { | |
namespace chrono = std::chrono; | |
auto const begin = chrono::system_clock::now(); | |
f(std::forward<Args>(args)...); | |
auto const end = chrono::system_clock::now(); |
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 <iterator> | |
#include <vector> | |
#include <algorithm> | |
void merge_sort(std::vector<int>& arr) { | |
if (arr.size() <= 1) return; | |
auto left = std::vector<int>(arr.begin(), arr.begin() + arr.size() / 2); | |
auto right = std::vector<int>(arr.begin() + arr.size() / 2, arr.end()); | |
merge_sort(left); |
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 <array> | |
#include <algorithm> | |
#include <iostream> | |
#include <tuple> | |
#include <utility> | |
template <typename ...Args, std::size_t N = sizeof...(Args)> | |
std::array<std::common_type_t<Args...>, N> make_array(Args&&... args) | |
{ | |
return {{std::forward<Args>(args)...}}; |
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 <iterator> | |
#include <type_traits> | |
template <class Container> | |
auto to_index(const Container& container, typename Container::const_iterator it) | |
-> decltype(std::distance(std::begin(container), it)) | |
{ | |
static_assert(std::is_same< | |
typename std::iterator_traits< | |
typename Container::const_iterator |
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 <initializer_list> | |
#include <iostream> | |
#include <string> | |
#include <tuple> | |
#include <type_traits> | |
#include <unordered_map> | |
#include <utility> | |
#include <vector> | |
template <typename F, typename... Args> |