GithubHelp home page GithubHelp logo

favreau / wtf Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 2.0 8 KB

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

CMake 55.01% C++ 44.99%
c-plus-plus c-plus-plus-11 swearing header-only syntax

wtf's Introduction

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

wtf's People

Contributors

favreau avatar kvanderlaag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kvanderlaag hamjo

wtf's Issues

Update the README

Several new pull requests have gone in, update the readme to match these changes

Fix containsShit to follow style

Redefine containsShit as size() > 0 work to keep it in the same style as doesnt_contain_shit
that is

x.contains_shit;
x.doesnt_contain_shit;

as opposed to

contains_shit(x);
x.doesnt_contain_shit;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.