Singleton in header only library

Posted by visionofarun on Jan 10, 2012 7:52 AM EDT; By Arun Chandrasekaran
Mail this story
Print this story

Static member variables are inevitable in singleton implementations. If we define the static member variable in the header file and include it in more than one source file, the linker would throw multiple definition errors when trying to link the translation units. So it is a little tricky to design the singleton in header only implementations. Nevertheless it is not difficult.

Full Story

» Read more about: Story Type: Tutorial; Groups: Linux

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.