Another fun one
-
When it comes to Multi-Threading it is always wise to be safer.
template<typename T>
class ItemTypeInfo
{
public:
//Get ItemTableName is callable from multiple threads
std::string GetItemTableName()
{
static std::string _strTypeName = GetStringFromRegistry();
return _strTypeName;
}
};Customer's complaint was that the application gave an error: "Database Table name is not valid". I struggled days to find this one out.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
-
When it comes to Multi-Threading it is always wise to be safer.
template<typename T>
class ItemTypeInfo
{
public:
//Get ItemTableName is callable from multiple threads
std::string GetItemTableName()
{
static std::string _strTypeName = GetStringFromRegistry();
return _strTypeName;
}
};Customer's complaint was that the application gave an error: "Database Table name is not valid". I struggled days to find this one out.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
Rama Krishna Vavilala wrote:
static std::string
:doh: But why?!
---- Scripts i’ve known... CPhog 1.8.2 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums
-
Rama Krishna Vavilala wrote:
static std::string
:doh: But why?!
---- Scripts i’ve known... CPhog 1.8.2 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums
Shog9 wrote:
But why?!
Because :)
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"