Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++14 support #21

Open
mjvankampen opened this issue Jan 5, 2020 · 8 comments
Open

C++14 support #21

mjvankampen opened this issue Jan 5, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@mjvankampen
Copy link
Contributor

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
Copy link
Owner

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++).

@FreeYourSoul FreeYourSoul self-assigned this Jan 6, 2020
@FreeYourSoul FreeYourSoul added the enhancement New feature or request label Jan 6, 2020
@mjvankampen
Copy link
Contributor Author

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
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link

jpiw commented Mar 3, 2020

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

@FreeYourSoul
Copy link
Owner

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

@sugdms
Copy link

sugdms commented May 12, 2020

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

@FreeYourSoul
Copy link
Owner

FreeYourSoul commented May 12, 2020

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 :

  • method ArgComp::compare : check arguments passed to a mocked function
  • method MockClassVerifier::verify : verify that all expected behaviors happened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants