Thread-Safe Variadic Printing Function
Mutex


class Mutex:private std::mutex{
  public:



Don't see the need for your custom Mutex/Lock class. Just use the standard ones directly there is no need to add a layer of indirection that future developers need to go and check.

Excessive Flushing

Calling flush after each item:


std::cout&lt;&lt;t&lt;&lt;std::flush;



Is probably not a good idea. Let the user of your code decide when to flush he probably has more concept about what what is about to be printed and thus when flush needs to be called.

If you must do it then do it after all the items have been printed.

Template Recusrsion.

Rather than using a recursive call to print all the items:


Print(ts...);



Use a sub class and create a std::initializer_list

// std::cout&lt;&lt;t&lt;&lt;std::flush;
// Print(ts...);
// Create a list. This will act more like a loop than recursion.
// Items inside the {} are initialized left to right.
auto printer = { ItemPrinter(ts)... };


Then ItemPrinter just prints the item in the constructor.

template&lt;typename T&gt;
struct ItemPrinter { ItemPrinter(T const&amp; t){std::cout &lt;&lt; t;}};


As a nice benifit. You will not need the terminating case.


void Print(){}



Naming Convention.


Print



It is more standard to use an initial capitol letter to define a type. An initial lower case letter donates an object (which also encompasses functions).

Since you have a nameless type. With an object called Print. I would have called it streamPrinter. Then used your wrapper functions call that directly.

Declaration

The code works well as is for a single file program. But you have problems when using it from header files. Because the class is nameless you can not use it any declarations to mark the object external and thus you will be getting an instantiation of the object in every compilation unit. This will break your guarantee that it is thread safe as each has its own mutex.

I think your best bet is to put the Print object in its own file. Then expose all printing via wrapper functions which can be made external in the header file.

Expansion.

Currently your printer is only used for std::cout. Why not expand it so that it can be used for any stream.