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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
#include <numeric> | |
using buffer_t = std::vector<char>; | |
using lines_t = std::vector<std::string>; |
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
template <int N = 0> | |
static auto&& ifconfig( | |
IP4::addr addr, | |
IP4::addr nmask, | |
IP4::addr router, | |
IP4::addr dns = IP4::INADDR_ANY | |
) | |
{ ... } | |
net::Inet4::ifconfig( |
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 <experimental\coroutine> | |
using namespace std::experimental; | |
coro_return_type<int> test() | |
{ | |
int val = 0; | |
//return {}; // return only valid for subroutines aka functions | |
// works only if coro_return_type::promis_type specifies: |
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
#ifndef TUPLEFOLD_CONCEPTS_H_INCLUDED | |
#define TUPLEFOLD_CONCEPTS_H_INCLUDED | |
#include <type_traits> | |
#include <string> | |
namespace util | |
{ | |
template<bool CONDITION> struct true_if : std::conditional_t<CONDITION, |
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
https://gcc.godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZTUAHAvVAOwGdK0AbVAV2J4OmAIIcAtiADkABmmk0Exnh6YA8mwDCCAIZtgmGfICUpDgOLIj0gPQAqAKSzR9gNQA1VKh5uAtG78LDyEAJ7OrhHuWkyhQsAIBG4QyCZuAEyytABsbgAy/ADWuhxuAEKYxMDoPr4BAO6NAHQ8RSV%2BAEaV1bVNbJgEUVFuACoIwm5oWG4TIdacmOiBbFjEbgQImG6ijLrIm/l48yIZTbLJiQSMXLa2TJicltZNJMC2cw8iHLY7e5t%2B6TOJiitgiYPSAGY8AAzFaYaGedTqPIAfQAqiMAJJ5TEjACaKIAEijMQA5LR5NEAEWwVPBEKw0Lw/URyPRWJx%2BKJJPJlJpdJc9OZyFa00cEK0ADdMMgiMRxdghWwRfwxRKOAQhAYFUqVWqtAR%2BIw1DrBS42LoJJgOLtrG5Jd4eGCAOxlMHmy3W21bIKqF1us2iW7%2BPwBSW6IS6fDISaoZSqLYsK1uRjEe7EAihSabZCFEN%2Bd2iAiYZQ8XTFtzirQdR1uGIrBVuDXEfiy9YtzAomEopIgJsEdAgFDsfAsdi6J0S%2BvoUjugCcGsHIE1/E7mcYmFnZoXA6H0InIh7oQ3YIh2CH662jld17pEIDogixdL5cwVZFJVKbrP/Zbbf6wDlqwbBuH2i5DsyxbAMQE4omgnAEPogwSjWPikG4YBgGUQ7hq0b4/tebrOneD5PiWxqvlWqG%2BNO6GXhayaiHRx4PJ65SNvwHDMsAsYrIQwGwUk4oCo%2BshzvRbHgcOfFjhak5aLR2zod%2B57Lix4qkS4z4UcWVYSVaTSGaMHCmqInHcbGEgSOwR4bj2lYQlS6wsQxWxSUo1lsLZ%2BFaCMHCGU0CoXup96FhEwahmGEZ4FGRxuHwwBHBObgdMyEZZlaiHQvwyqyaUkWFtpZa6ShjoBY2za |
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
http://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAM1QDsCBlZAQwBtMQBGAOgFYAGQUOHCALKQBWXUqgAOBPHQDOlNK1QBXYniWYAgkoC2IAOT8TpNIdl52AeVoBhBM1rAOZkwEpSSzcWQPAFIAJgBmPCpaLCoAagARbAAZbABxPQAVbAB9AAkABXzsgEkAOUckgFVE%2BKD%2BPVCwmLxaTATktMycgqKyiursWvq6hvCW5FYNLFigsMcCAE9ZTGyCYmZCJVnsEcbxyenZxyoNWmQFOjZt3bGzg7ajw0xDEgXt2IB6D9ji2KVmdCxSi7epfWIAWkhkNiDAAmqU7PkGMUGBCoeCQXpaMwnkpZMxAn9lshdgB2ABCIIAnARnrJWMxaUclHgAF4rAh/NmYUixRbLbFPWIAJV5/Mwgsw3GlsT0xGAWzC2FiE2YSiUsVkWkws0pw34NLpDKZcxZ7NWXPZYqWEpxbVFfJtkul3Fl8sVytV6tiLXpBI52gAbrrqbTrMadabuRazTzHQK7SLrQmni63Qr3l6Nb6GYEQ/rDeHGZHHLGY9zk7ahQ7xc6ZXKM0qVQzvegFoK8CSwnqGqShg16pK8f7YlgCBtWGSe3UqWhaEpaQAPWTES0c0eYKjMDSsAjZFj45CEBYzMLxNeoKgQMsELyxABUsVE%2BYHs%2BUS5Xa4tMW3u%2BybDwYBaCeehT3PWNL2vaNbxfII%2B0xEYwz9E1HFDJ1EwyUhQyNYtmWgytJQIu0XUzFsNQYYkwKJTBkBAEAc39LCCxvNcqLHCc6J/Hc9wPAlj12JURizDd2GAXDu0%2Bb5TjxGjIjwTB0ExJCIyONCU3tIjU3rd0mNfZTxNLfD4yrONa2I6VSLVcjiV0mcWNjASdnqYSsFEgzhQgBslBdHwYRstdrm7BDQW%2BdFwR%2BABZfIUgi7BSgyTJijsUo0ShTEh0PNp2NsKdEJwlCzOrTSpW0xtlQXRlOxFWI6UWb |
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
/* | |
####################### dirtyc0w.c ####################### | |
$ sudo -s | |
# echo this is not a test > foo | |
# chmod 0404 foo | |
$ ls -lah foo | |
-r-----r-- 1 root root 19 Oct 20 15:23 foo | |
$ cat foo | |
this is not a test | |
$ gcc -pthread dirtyc0w.c -o dirtyc0w |
OlderNewer