hamjo / WTF

WTF is a header-only c++11 library that helps you introduce a lot of swearing in your code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

WTF is a header-only c++11 library that helps you introduce a lot of swearing in your code. Since my english is not the best at that kind of exercise, feel free to contribute. Every pull request will be happily merged, for as long as it makes me laugh!

Happy swearing!

Examples

Testing null pointers

if(!pointer)
   exit();

becomes

if(pointer sucks)
   then_fuck_it

Testing empty containers

std::vector<size_t> ints;
if(ints.empty())
  ...

becomes

std::vector<size_t> ints;
if(ints.contains_shit)
  ...

Conversely,

std::vector<size_t> ints;
if(!ints.empty())
  ...

becomes

std::vector<size_t> ints;
if(ints.doesnt_contain_shit)
  ...

Exceptions

throw std::runtime_error("...");

becomes

throw the_finger("...");

Returning

int add(int x, int y){
  int result = x + y;
  return result;
}

becomes

int add(int x, int y){
  int result = x + y;
  fucking_done_with result;
}

Building from source

mkdir build
cd build
cmake ..
make

About

WTF is a header-only c++11 library that helps you introduce a lot of swearing in your code


Languages

Language:CMake 55.0%Language:C++ 45.0%