doe300 / VC4C

Compiler for the VC4CL OpenCL implementation
MIT License
117 stars 37 forks source link

Add: add `make_optional` for type inference #118

Closed nomaddo closed 5 years ago

nomaddo commented 5 years ago

@doe300 BTW, why don't you use std::optional or std::experimental::optional directory? In current implementation of Optional, some functions are missing.

Do we have any reason we cannot write template<T> using Optional = std::experimental::optional<T> ?

doe300 commented 5 years ago

The problem is that std::optional is introduced in C++17 which is not supported by the GCC 6 on the Raspberry Pi. On the other side, my PC supports it and therefore the header/class std::experimental::optional does not exist.

Also, Optional provides a hand full of functions which are not provided by either standard-optional, that is why it is not just an alias. I will have a look whether I can rewrite everything to remove the type completely and just replace it with an alias.