Beast has some global functions in its headers (for instance, clamp in boost/beast/core/detail/clamp.hpp) that are declared static. static global functions are inaccessible to the second phase of name lookup in templates instantiated outside of the module. So for instance, if I have a module like
If a user attempts to call Thingy::f, they will get an error message like
boost/beast/websocket/impl/write.hpp:238:35: fatal error: no matching function for call to 'clamp'
238 | bytes_transferred_ += clamp(fh_.len);
This is because the clamp overloads are declared static (in the "translation-unit local" sense).
Removing static would fix this problem. clamp is a set of function templates so it doesn't need any other change. I'm not sure if there are other functions that have a similar issue, but that's the only one I've run into so far.
Beast has some global functions in its headers (for instance,
clamp
inboost/beast/core/detail/clamp.hpp
) that are declaredstatic
.static
global functions are inaccessible to the second phase of name lookup in templates instantiated outside of the module. So for instance, if I have a module likeIf a user attempts to call
Thingy::f
, they will get an error message likeThis is because the
clamp
overloads are declaredstatic
(in the "translation-unit local" sense).Removing
static
would fix this problem.clamp
is a set of function templates so it doesn't need any other change. I'm not sure if there are other functions that have a similar issue, but that's the only one I've run into so far.