Sharing through static member data can be very useful. Here's an example.
We've decided to communicate between two processes in our application using
enqueued messages. There may be several parts of the sending process's code that need to create and post messages. If they are in different scopes how
do they all access the queue?
It would be hard to make a simple elegant design that passed references to the queue into every scope that needs access.
If we write a small wrapper class that holds a static instance of the queue and makes it available, the code in any other scope that needs access can
simply declare an instance of the wrapper class to get to the queue. If the queue is thread-safe, then the wrapper becomes very easy to use.
In C++ we can declare the wrapper as a template type that takes an integral type
as a template parameter. That will create seperate types for each value of the parameter and so we can define queues that are shared by different
categories of users, e.g., those that need acess to an input queue and those that need access to an output queue.