Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i think you could actually do that in C++ as a library with a bit of metaprogramming. the arithmetic operations will get weird though unless everything is the same type, for example what is the result type of int<-10, 10>+int<0, 20>? (the "right" answer is probably a megabyte of compiler errors)


Surely just `int`?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: