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
| 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 |
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
| #!/bin/bash | |
| function find_sources() { | |
| find Firestore/Source Firestore/Example/Tests Firestore/core \( \ | |
| -name \*.m -o -name \*.cc -o -name \*.mm \ | |
| } | |
| function find_object_names() { | |
| find_sources | sed 's,.*/,,; s/\.[^\.]*$/.o/' |
| #include <iostream> | |
| #include <utility> | |
| struct Noisy { | |
| Noisy() {} | |
| Noisy(const Noisy&) { std::cout << "copied\n"; } | |
| Noisy(Noisy&&) {} | |
| ~Noisy() {} | |
| }; |