Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Dependent types

Name: Anonymous 2018-10-12 17:08

So, why are you not using dependent types yet? Do you like your programs randomly crashing?

Name: Anonymous 2018-10-14 15:24

>>45
while the head function requires a value of type Vect (n + 1) Int
In that case dependent types are safer.
Its likely possible within the class to add static_assert or exotic set of constexprs to fail template instantiation, but your argument is that the programmer can also fuck up the static_assert/constexpr's too. There is however a modern alternative to this, C++ concepts:

C++ concepts can be enabled in gcc with -fconcepts and is probably the closest thing to implementing dependent type
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Concepts.html

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List