This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define _WEBSOCKETPP_CPP11_STL_ | |
//#define _WEBSOCKETPP_RVALUE_REFERENCES_ | |
//#define _WEBSOCKETPP_DELETED_FUNCTIONS_ | |
#include <websocketpp/config/asio_no_tls.hpp> | |
#include <websocketpp/client.hpp> | |
#include <boost/coroutine/all.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==2009== Memcheck, a memory error detector | |
==2009== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==2009== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info | |
==2009== Command: ./server 9001 | |
==2009== | |
[2015-01-01 08:21:53] [connect] WebSocket Connection 127.0.0.1:34928 v13 "WebSocket++/0.4.0" / 101 | |
==2009== Invalid read of size 8 | |
==2009== at 0x4162F5: boost::asio::detail::reactive_socket_service_base::destroy(boost::asio::detail::reactive_socket_service_base::base_implementation_type&) (in /home/kondo/work/training/code/cpp/websockets/server) | |
==2009== by 0x435D08: boost::asio::socket_acceptor_service<boost::asio::ip::tcp>::destroy(boost::asio::detail::reactive_socket_service<boost::asio::ip::tcp>::implementation_type&) (in /home/kondo/work/training/code/cpp/websockets/server) | |
==2009== by 0x431E6C: boost::asio::basic_io_object<boost::asio::socket_acceptor_service<boost::asio::ip::tcp>, true>::~basic_io_object() (in /home/kondo/work/training/code/cpp/websockets/server) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
#include <iostream> | |
// ------------------------------------------------- | |
// You need to include msgpack_fwd.hpp for overload. | |
#include <msgpack_fwd.hpp> | |
// ------------------------------------------------- | |
struct my { | |
int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Powerd by | |
// http://stackoverflow.com/questions/11632219/c-preprocessor-macro-specialisation-based-on-an-argument | |
// For both C++03 and C++11 | |
#include <iostream> | |
// --- begin client code --- | |
#define MSGPACK_API_VERSION 1 | |
// --- end client code --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <soci.h> | |
#include <sqlite3/soci-sqlite3.h> | |
#include <boost-fusion.h> | |
#include <iostream> | |
#include <boost/fusion/include/define_struct.hpp> | |
#include <boost/fusion/include/for_each.hpp> | |
using namespace soci; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/variant.hpp> | |
#include <msgpack.hpp> | |
// Definition of the variant type. | |
// The types appear the following example are supported. | |
// {'metadata': {'date': '2014-06-25', 'user_id': 501}, | |
// 'values': [3.1, 4.1, 5.1], | |
// 'version': 1} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This program requires the C++11 compiler, | |
// e.g.) g++ -std=c++11 ... | |
// clang++ -std=c++11 ... | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
#include <msgpack.hpp> | |
void print(char const* buf, std::size_t size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msgpack.h> | |
#include <stdio.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
msgpack_unpacker* unp = msgpack_unpacker_new(100); | |
msgpack_unpacked result; | |
bool ret; | |
char* buf; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/msgpack/cpp_config.hpp b/src/msgpack/cpp_config.hpp | |
index b80573a..8db6d25 100644 | |
--- a/src/msgpack/cpp_config.hpp | |
+++ b/src/msgpack/cpp_config.hpp | |
@@ -45,6 +45,15 @@ T const& move(T const& t) | |
return t; | |
} | |
+template <bool P, typename T = void> | |
+struct enable_if { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// ---- library code ---- | |
namespace msgpack { | |
void foo(int) { std::cout << "v1::foo(int)" << std::endl; } | |
} | |
// ---- client code ---- |