Mentions légales du service

Skip to content

1507 strong types

DIAZ Jerome requested to merge jediaz/MoReFEM:1507_strong_types into master

Introduce strong types as a utility part of the CoreLibrary. Strong types allow for a more expressive code at functions' calling sites by ensuring that the order of the arguments is the one intended. For instance we could make sure that when constructing a Rectangle defined by its length and width we do not swap the two arguments. The idea is that StrongRectangle rectangle((Width(5.0)), (Height((2.0)))) is more expressive and less error-prone than Rectangle rectangle(5.0, 2.0). The implementation is adapted from https://github.com/joboccara/NamedType

Merge request reports