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
set(LLVM_LINK_COMPONENTS support) | |
add_clang_executable(my_refactor | |
my_refactor.cpp | |
) | |
target_link_libraries(my_refactor | |
clangTooling | |
clangBasic | |
clangASTMatchers | |
) |
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<boost/hana/filter.hpp> | |
#include<utility> | |
#include "hpesoj_utility.hpp" | |
namespace hana = boost::hana; | |
struct is_even_t { | |
template <int i> | |
struct apply { |
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<boost/hana.hpp> | |
#include<boost/hana/experimental/types.hpp> | |
namespace hana = boost::hana; | |
namespace hanax = boost::hana::experimental; | |
int main() { | |
{ | |
constexpr auto xs = hanax::types< | |
hana::int_<1>, |
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
// | |
// Copyright Jason Rice 2016 | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
#ifndef NBDL_DETAILS_PARTIAL_REF_HPP | |
#define NBDL_DETAILS_PARTIAL_REF_HPP | |
#include<boost/hana.hpp> |
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<boost/hana.hpp> | |
#include<iostream> | |
namespace hana = boost::hana; | |
template<typename T> | |
class A | |
{ | |
static constexpr const char* t = hana::to<const char*>(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
#include<type_traits> | |
#include<iostream> | |
template<typename T1, typename T2> | |
class Moo | |
{ | |
T1 t1; | |
T2 t2; | |
public: |
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
CC=clang++ -std=c++14 | |
all: main | |
main: main.cpp all.hpp.pch | |
$(CC) main.cpp -include-pch all.hpp.pch -o main | |
all.hpp.pch: expensive.hpp | |
$(CC) expensive.hpp -o all.hpp.pch |
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
function is_prime(n : integer) | |
if n ≤ 1 | |
return false | |
else if n ≤ 3 | |
return true | |
else if n mod 2 = 0 or n mod 3 = 0 | |
return false | |
let i ← 5 | |
while i×i ≤ n | |
if n mod i = 0 or n mod (i + 2) = 0 |
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
cmake_minimum_required(VERSION 2.8) | |
add_definitions(-std=c++14) | |
add_definitions(-Wall) | |
add_definitions(-Wextra) | |
include_directories("/usr/local/include") | |
add_executable(large_map_1 | |
large_map_1.cpp |
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<boost/hana.hpp> | |
namespace hana = boost::hana; | |
auto list_with_no_dups = | |
hana::unpack( | |
hana::range_c<int, 0, 50>, | |
[](auto... i) { | |
return hana::tuple_c<int, i...>; | |
}); |