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> | |
using namespace std; | |
class Button | |
{ | |
protected: | |
class Border { | |
public: | |
using Color = int; |
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> | |
using namespace std; | |
class Button | |
{ | |
protected: | |
class Border { | |
public: | |
using Color = int; |
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
class A { | |
public: | |
int func() { return 21; } | |
}; | |
class B : public A { | |
public: | |
int func() { return A::func(); } | |
}; |
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
inline std::ostream& operator << (std::ostream& os, ssu::base_stream::packet const& pkt) | |
{ | |
std::string packet_type = [](stream_protocol::packet_type type){ | |
switch (type) { | |
case stream_protocol::packet_type::invalid: return "invalid"; | |
case stream_protocol::packet_type::init: return "init"; | |
case stream_protocol::packet_type::reply: return "reply"; | |
case stream_protocol::packet_type::data: return "data"; | |
case stream_protocol::packet_type::datagram:return "datagram"; | |
case stream_protocol::packet_type::ack: return "ack"; |
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
inline std::ostream& operator << (std::ostream& os, ssu::base_stream::packet const& pkt) | |
{ | |
static std::unordered_map<stream_protocol::packet_type,std::string> packet_types { | |
{stream_protocol::packet_type::invalid, "invalid"}, | |
{stream_protocol::packet_type::init, "init"}, | |
{stream_protocol::packet_type::reply, "reply"}, | |
{stream_protocol::packet_type::data, "data"}, | |
{stream_protocol::packet_type::datagram, "datagram"}, | |
{stream_protocol::packet_type::ack, "ack"}, | |
{stream_protocol::packet_type::reset, "reset"}, |
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 <algorithm> | |
#include <locale> | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int i = 0; | |
string s; |
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
// | |
// From GoingNative 2013 "Inheritance is the Base Class of Evil" talk. | |
// | |
#include <memory> | |
#include <iostream> | |
#include <vector> | |
#include <cassert> | |
using namespace std; |
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
uia::routing::internal::regserver_client regclient(host.get()); | |
uia::routing::client_profile client; | |
client.set_host_name("myhost.local"); | |
client.set_owner_name("Name"); | |
client.set_city("City"); | |
client.set_region("Region"); | |
client.set_country("Country"); | |
client.set_endpoints(set_to_vector(host->active_local_endpoints())); | |
regclient.set_profile(client); |
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
In file included from test.cpp:1: | |
In file included from /usr/include/c++/v1/memory:603: | |
/usr/include/c++/v1/tuple:267:11: error: rvalue reference to type 'test::private_tag' cannot bind to lvalue of type | |
'test::private_tag' | |
: value(__t.get()) | |
^ ~~~~~~~~~ | |
/usr/include/c++/v1/tuple:385:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, test::private_tag &&, | |
false>::__tuple_leaf' requested here | |
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...> | |
^ |
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
> clang -c gistfile1.c | |
gistfile1.c:26:22: warning: duplicate 'const' declaration specifier | |
[-Wduplicate-decl-specifier] | |
static const int const oparray[]= | |
^ | |
gistfile1.c:176:17: warning: format specifies type 'int *' but the argument has | |
type 'inst *' (aka 'unsigned long long *') [-Wformat] | |
READ_AND_SET_IMMV(1); | |
^~~~~~~~~~~~~~~~~~~~~ | |
gistfile1.c:166:33: note: expanded from macro 'READ_AND_SET_IMMV' |