FreeYourSoul / FSeam

Cpp header only library to manage compile time mock class generated via Python script
MIT License
86 stars 8 forks source link

C++14 support #21

Open mjvankampen opened 4 years ago

mjvankampen commented 4 years ago

Is your feature request related to a problem? Please describe. I develop using some more obscure operating systems (such as QNX) that mostly support C++14 and not newer. This means I cannot use FSeam.

Describe the solution you'd like If possible identify where C++17 is required and evaluate if those parts can be replaced by something C++14 compatible.

Describe alternatives you've considered Switching to other OS is not a possibility as these systems are hard-realtime.

FreeYourSoul commented 4 years ago

The usage of constexpr if is mainly the blocking point, we can implement some classic meta-prog to replace those but it may take some time (if I do such thing, I may do it on another branch as my goal with FSeam would be more going toward the most up to date version of C++).

mjvankampen commented 4 years ago

Alright, I understand. I do think FSeam has an excellent application area in embedded development where you would like to avoid virtual function calls. Unfortunately a lot of compilers are a bit older in that area and do not all support C++17 or newer. Especially in mission critical equipment where things like AUTOSAR guidelines are applied.

FreeYourSoul commented 4 years ago

I see, if you think FSeam may be used in actual projects only if it allows a retro-compatibility with lower standards version I would be happy to implement it, I am just scared of a potential ifdef/endif forest that would hinder the code readability.

mjvankampen commented 4 years ago

I agree with the forest. Maybe better to leave it as is and see if more people run into this. Otherwise C++17 might be ok.

jpiw commented 4 years ago

I would need c++11 support, if I can count as more people.

FreeYourSoul commented 4 years ago

I am thinking about a good way to do it. I will develop this when I have more time

sugdms commented 4 years ago

Can you elaborate on what the C++17 features are that FSeam is dependent upon?

FreeYourSoul commented 4 years ago

The biggest one is the usage of constexpr if. The best solution in order to support C++14, may be to remove the usage of constexpr if instead of using #ifdef which would really impact code readability. Overall, it shouldn't be too hard to modify as the template arguments are at function template level and not struct level. Doing some SFINAE on those templated method should do the trick.

constexpr if used in :