This file contains 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 <sol.hpp> | |
#include <iostream> | |
#include <tuple> | |
std::string free_func_yo( ) { | |
std::cout << "free_func_yo()" << std::endl; | |
return "test"; | |
} | |
struct member_test { |
This file contains 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 <sol.hpp> | |
#include <iostream> | |
#include <tuple> | |
std::string free_func_yo() { | |
std::cout << "free_func_yo()" << std::endl; | |
return "test"; | |
} | |
struct member_test { |
This file contains 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
// GC table | |
void** freshuserdata = static_cast<void**>( lua_newuserdata( state( ), sizeof( userdata ) ) ); | |
*freshuserdata = userdata; | |
lua_newtable( state( ) ); /* create metatable. */ | |
stack::push( state( ), "__gc" ); /* push key '__gc' */ | |
stack::push( state( ), destroyfunc, 0 ); /* push gc method. */ | |
lua_rawset( state( ), -3 ); /* metatable['__gc'] = userdata_gc_method */ | |
lua_setmetatable( state( ), -2 ); /* set the userdata's metatable. */ | |
// Actual function call we want |
This file contains 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
void breaking() { | |
std::cout << "Nice!~\n"; | |
} | |
std::tuple<double, double> breaking_multi() { | |
return std::make_tuple(567.2, 2.567); | |
} | |
struct a_type { | |
std::tuple<double, double> breaking_multi() { |
This file contains 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
[1/2] Compiling sol.scratch.cpp | |
FAILED: g++ -MMD -MF obj/sol.scratch.o.d -std=c++11 -pedantic -pedantic-errors -Wextra -Wall -O2 -DNDEBUG -c sol.scratch.cpp -o obj/sol.scra | |
tch.o -I"." -I"./include" -I"." -I"./lua-5.2.2/src/" -I"./Catch/include/" | |
In file included from ./sol/table.hpp:26:0, | |
from ./sol/state.hpp:26, | |
from ./sol.hpp:25, | |
from sol.scratch.cpp:3: | |
./sol/lua_function.hpp: In instantiation of 'static int sol::static_lua_func<TFx>::typed_call(sol::types<Args ...>, sol::types<Args ...>, so | |
l::static_lua_func<TFx>::fx_t*, lua_State*) [with TRn = {int}; Args = {int, int, std::basic_string<char, std::char_traits<char>, std::alloca | |
tor<char> >}; TFx = int (&)(int, int, std::basic_string<char>); sol::static_lua_func<TFx>::fx_t = int(int, int, std::basic_string<char>); lu |
This file contains 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
public static void GetBytes ( UInt16 data, byte[] bytes, int offset ) { | |
bytes[ offset++ ] = (byte)( data & 0xFF ); | |
bytes[ offset++ ] = (byte)( ( data >> 8 ) & 0xFF ); | |
} |
This file contains 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
public class Endian { | |
public static readonly Endian Big = new Endian { | |
n20 = 1, | |
n21 = 0, | |
n40 = 3, | |
n41 = 2, | |
n42 = 1, | |
n43 = 0, | |
n80 = 7, | |
n81 = 6, |
This file contains 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
ptr<IDXGIFactory, release_deleter> factory = null; | |
r = CreateDXGIFactory( __uuidof( IDXGIFactory ), static_cast<void**>( &factory ) ); | |
if ( r != 0 ) | |
throw ErrorCodeException( "Unable to create a DXGI Factory.", r ); |
This file contains 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
using System.Collections.Generic; | |
namespace LoungeChat.Server { | |
public class WebSocketExtensionStack { | |
private List<IWebSocketExtension> _extensionstack = null; | |
private List<IWebSocketExtension> _acceptedextensionstack = new List<IWebSocketExtension>( ); | |
public WebSocketExtensionStack( IEnumerable<IWebSocketExtension> extensions ) { |
This file contains 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
#pragma once | |
#include <cstddef> | |
#include <type_traits> | |
#include <initializer_list> | |
#include <algorithm> | |
namespace Furrovine { | |
template <typename T, std::size_t n, std::size_t a = std::alignment_of<T>::value> |
OlderNewer