Skip to content

Instantly share code, notes, and snippets.

Andrew H. Cox ahcox

Block or report user

Report or block ahcox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ahcox
ahcox / error_log.cpp
Last active Aug 18, 2017
Error log using stlab develop branch at commit 255379c430c002d75efe1e3218ea4fc92255421a Author: Sean Parent Date: Tue Jul 25 23:25:59 2017 -0700 Backing out an unintentional change.
View error_log.cpp
/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/ahcox/Library/Caches/CLion2016.2/cmake/generated/stlab_experiments-e68879c1/e68879c1/Debug --target async_error_repro2 -- -j 8
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ahcox/Library/Caches/CLion2016.2/cmake/generated/stlab_experiments-e68879c1/e68879c1/Debug
[ 50%] Building CXX object CMakeFiles/async_error_repro2.dir/async_error_repro2.cpp.o
In file included from /Users/ahcox/checkouts/stlab_experiments/async_error_repro2.cpp:9:
In file included from /Users/ahcox/checkouts/stlab/stlab/concurrency/future.hpp:22:
In file included from /Users/ahcox/checkouts/stlab/stlab/concurrency/executor_base.hpp:16:
/Users/ahcox/checkouts/stlab/stlab/concurrency/task.hpp:78:52: error: no matching function for call to object of type 'std::__1::__bind<(lambda at /Users/ahcox/checkouts/stlab/stlab/concurrency/future.hpp:1278:19), const int &, const long double &, std::__1::reference_wrapper<SharedState> >'
R in
@ahcox
ahcox / async_error_repro2.cpp
Last active Aug 18, 2017
Repro for async not accepting reference parameters wrapped in std::ref and std::cref
View async_error_repro2.cpp
//
// Created by Andrew Cox 2017.
//
#include <iostream>
#include <future>
#include <stlab/concurrency/default_executor.hpp>
#include <stlab/concurrency/future.hpp>
@ahcox
ahcox / async_error_repro1.cpp
Created Aug 17, 2017
Repro for stlab::async() not accepting non-const reference parameters
View async_error_repro1.cpp
//
// Created by Andrew Cox 2017.
//
#include <iostream>
#include <future>
#include <stlab/concurrency/default_executor.hpp>
#include <stlab/concurrency/future.hpp>
@ahcox
ahcox / dump_touch.cpp
Last active Aug 7, 2017
Dump a Cocos2D-x Touch to an ostream like std::cerr
View dump_touch.cpp
void dumpTouch(std::ostream& out, const cocos2d::Touch* touch)
{
if(touch){
const auto loc = touch->getLocation();
const auto prev = touch->getPreviousLocation();
const auto start = touch->getStartLocation();
const auto delta = touch->getDelta();
const auto id = touch->getID();
const auto viewLoc = touch->getLocationInView();
const auto viewPrev = touch->getPreviousLocationInView();
You can’t perform that action at this time.