Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Oberstein oberstet

View GitHub Profile
View gist:9783319
oberstet@corei7ub1310:~/scm/tavendo/autobahn/AutobahnCpp$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
clang++ -o build/test/test10.o -c -std=c++11 -stdlib=libc++ -Wall -Wno-deprecated-declarations -pthread -I/home/oberstet/boost -Iinclude -I/home/oberstet/msgpack_clang/include test/test10.cpp
test/test10.cpp:14:44: error: no viable conversion from 'future<typename detail::when_type<class future<int> &, class future<int> &>::container_type>' to
'future<tuple<future<int>, future<int> >>'
future<tuple<future<int>, future<int>>> f3 = when_all(f1, f2);
^ ~~~~~~~~~~~~~~~~
/home/oberstet/boost/boost/thread/future.hpp:1542:9: note: candidate constructor not viable: no known conversion from 'future<typename detail::when_type<future<int> &,
View gist:9783359
#include <iostream>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
int main() {
View gist:9783364
oberstet@corei7ub1310:~/scm/tavendo/autobahn/AutobahnCpp$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
clang++ -o build/test/test10.o -c -std=c++11 -stdlib=libc++ -Wall -Wno-deprecated-declarations -pthread -I/home/oberstet/boost -Iinclude -I/home/oberstet/msgpack_clang/include test/test10.cpp
In file included from test/test10.cpp:6:
/home/oberstet/boost/boost/thread/future.hpp:4608:7: warning: expression result unused [-Wunused-value]
typename alias_t<char[]>::type{
^ ~
/home/oberstet/boost/boost/thread/future.hpp:4768:15: note: in instantiation of function template specialization
View gist:9785686
#include <iostream>
#include <vector>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
View gist:9781098
$ python
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from twisted.internet.endpoints import clientFromString
>>> from twisted.internet import reactor
>>> c = clientFromString(reactor, "tcp:127.0.0.1:8080")
>>> import twisted
>>> twisted.__version__
'13.2.0'
>>>
View gist:9785300
#include <iostream>
#include <vector>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
View gist:9785311
#include <iostream>
#include <vector>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
View gist:9785331
#include <iostream>
#include <vector>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
View gist:10464024
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class IMessage(object):
@abc.abstractmethod
def foo(self):
pass
View gist:4ea003fd8e91dcb9cba3
import inspect
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from autobahn.twisted import util
def foo1():
print("foo1")
return 1
@inlineCallbacks