szaszm commented on a change in pull request #926:
URL: https://github.com/apache/nifi-minifi-cpp/pull/926#discussion_r507780131
##########
File path: libminifi/include/utils/Id.h
##########
@@ -65,10 +67,11 @@ class Identifier {
bool operator!=(const Identifier& other) const;
bool operator==(const Identifier& other) const;
+ bool operator<(const Identifier& other) const;
bool isNil() const;
- std::string to_string() const;
+ SmallString<36> to_string() const;
Review comment:
You convinced me that returning a UUIDString is not a bad thing in
itself.
> I generally like if the types convey their usage, so we can have functions
expecting `UUIDString`
But they accept any `SmallString<36>` including other typedefs, the type
safety is not great here and we can make the mistake of passing
`"banana789012345678901234567890123456"` (36 chars). Returning or passing
`UUIDString` this way is a lie because we return/accept much more than just
that.
Since this is a minor detail and strong typedefs don't exist, I'm fine with
either way with a preference towards `SmallString<36>` for less lying versus
`UUIDString` for more talkative naming.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]