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
double jaro_string_similarity(boost::string_ref a, boost::string_ref b) | |
{ | |
using std::cbegin; | |
using std::cend; | |
using std::distance; | |
if(a.empty()) { | |
return b.empty() ? 1.0 : 0.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
#include <iostream> | |
#include <utility> | |
using namespace std; | |
struct F { | |
F() = default; | |
F(const F&) = delete; | |
F& operator =(const F&) = delete; |
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 D, typename T> | |
struct base_last_match_recorder { | |
// Exploits CRTP to "up-reference" this instance from the perspective of the | |
// derived class D | |
void operator()(const T &v, int p) { | |
if(static_cast<D*>(this)->match(v)) { | |
static_cast<D*>(this)->position = p; | |
static_cast<D*>(this)->value = v; | |
} | |
} |
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
U-Boot 1.1.4-ga35cd45d-dirty (Jun 22 2018 - 12:48:24) | |
ar750s - Dragonfly 1.0DRAM: | |
sri | |
ath_ddr_initial_config(278): (ddr2 init) | |
ath_sys_frequency: cpu 775 ddr 650 ahb 258 | |
Tap values = (0x10, 0x10, 0x10, 0x10) | |
128 MB | |
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18 | |
flash size 16MB, sector count = 256 |
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
// Test suite for type_lists | |
// The tests are all static asserts so that successful compilation of this | |
// translation unit indicates all tests passed. | |
#include <cstdlib> | |
#include <type_list.hpp> | |
using std::is_same; |