Skip to content

michaelzs85/QuickType

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickType

Build Status

A C++ Library to support strong type safety.

Easily define your own interface types.

#include "quick_type.h"
#include <iostream>

using MyType = quick_type<int, struct UniqueTagToDistinguishTypes, Addition, Subtraction, Printable>;

void do_something(MyType x)
{
    MyType y{250};
    std::cout << x + y << "\n"; // works because addition is allowed
    std::cout << x * y << "\n"; // compile error multiplication not allowed
}


int main()
{
    MyType k{99};
    do_something(k);
    return 0;
}

The goal is to have type checking at compile time to minimize errors and keeping compiled programs efficent.

About

A C++ Library to support strong type safety.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •