Skip to content

Instantly share code, notes, and snippets.

View BillyONeal's full-sized avatar

Billy O'Neal BillyONeal

View GitHub Profile
@BillyONeal
BillyONeal / boyer_moore.cpp
Created April 1, 2017 01:34
Boyer-Moore Searcher Comparative Benchmark
#include <algorithm>
#include <functional>
#include <string>
#include <string_view>
#include <benchmark/benchmark.h>
#include "file.hpp"
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@BillyONeal
BillyONeal / equivalent.cpp
Created February 21, 2017 05:39
std::filesystem::equivalent
#include <vcruntime.h>
__std_win32_error __std_fs_equivalent(bool * _Result, const wchar_t *_Path1, const wchar_t *_Path2) noexcept
{ // test for equivalent file names
const __vcp_unique_handle _Handle1(_FilesysOpenFile(_Path1, FILE_READ_ATTRIBUTES,
FILE_FLAG_BACKUP_SEMANTICS));
if (!_Handle1.is_valid())
{
*_Result = false;
return (GetLastError());
; Function compile flags: /Ogtpy
; COMDAT ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z
_TEXT SEGMENT
__Right$ = 8 ; size = 4
?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::swap, COMDAT
; _this$ = ecx
; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring
; Line 1857
00000 56 push esi
00001 57 push edi
@BillyONeal
BillyONeal / example_use.cpp
Last active November 19, 2022 14:20
Death testing
#include <stddef.h>
#include <string_view>
#include <pmretvals.h>
#include <test_death.hpp>
using namespace std;
int test_case_operator_dereference_value_initalized_iterator() {
string_view::iterator it; // note: for IDL to work correctly, default init and value init are equivalent