Skip to content

Instantly share code, notes, and snippets.

@wilhuff
wilhuff / CMakeLists.txt
Last active December 5, 2019 18:57
XCTest bundle resources issue
cmake_minimum_required(VERSION 3.5.1)
project(bundle-resources VERSION 0.0.1 LANGUAGES C CXX)
enable_testing()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(
objc_flags
@wilhuff
wilhuff / README.md
Created September 3, 2019 19:21
id in C++ class works from Objective-C

Build and test like so:

$ clang++ -std=c++11 test_class.cc main.mm -framework Foundation
$ ./a.out

2019-09-03 12:18:13.640 a.out[85486:6585983] The answer is 42

@wilhuff
wilhuff / benchmark.sh
Last active September 3, 2019 16:06
benchmark builds
#!/bin/bash
function find_sources() {
find Firestore/Source Firestore/Example/Tests Firestore/core \( \
-name \*.m -o -name \*.cc -o -name \*.mm \
\) -print
}
function find_object_names() {
find_sources | sed 's,.*/,,; s/\.[^\.]*$/.o/'
@wilhuff
wilhuff / test.cc
Created April 19, 2018 01:28
Does copy elision make std::move obsolete?
#include <iostream>
#include <utility>
struct Noisy {
Noisy() {}
Noisy(const Noisy&) { std::cout << "copied\n"; }
Noisy(Noisy&&) {}
~Noisy() {}
};