Earlier quoted context omitted.
I mean, this would be relatively easy to implement in any language that have operator overloading.
How do you operator overload in C++ so that calling computeHmac(secret(string)) returns secret(string)?
Then define the equals operator for "secret" to behave in the needed way.