On Mon, 31 Dec 2018 at 10:00, Ireneusz Szcześniak via Boost-users < boost-users@lists.boost.org> wrote:
Thank you for your email, but you missed the point of my email.
Possibly. Please note that in the foo function I'm not using parameter t, so the
use of the forwarding (universal) reference cannot be inappropriate.
I assumed __PRETTY_FUNCTION__ was doing something with t. If that is not doing something with t, what are you pretty printing then? Are you saying that you want to print something different depending upon the type [but unrelated to the value of t]? Overloading is still the [an] answer, though. It would be helpful if you state more clearly what you want to do and why you think you need a UR. This SO-question goes into some depth to explain the differences [it's more intricate than it seems, but once you got the hang of it in practice it's quite easy]. In the case of PODs [as in your examples], all this is rather moot, and you can just as well use value-semantics. template<typename Stream> [[ maybe_unused ]] Stream & operator << ( Stream & out_, const point2f & ) noexcept { out_ << "I'm using a type called point2f"; return out_; } A parameter that's not used does not have to have a name. degski -- *“If something cannot go on forever, it will stop" - Herbert Stein*