The Wayback Machine - https://web.archive.org/web/20120913103809/http://www.devx.com:80/getHelpOn/
advertisement
Login | Register   
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
advertisement
advertisement

Past Get Help 10-Minute Solutions

October 15, 2009
The "most vexing parse" is a mysterious syntactic specter that the compiler interprets in the least expected manner, biting innocent programmers who think their code means something entirely different. Find out where that vexing parse might occur and how to avoid it.
September 17, 2009
A base class with multiple constructors forces a derived class to define corresponding constructors that merely forward their arguments to the matching base constructor. In C++03, you define the derived class's constructors manually. Learn how C++0x's inheriting constructors feature automates this process, thereby simplifying code maintenance and making your code more readable and secure.
July 16, 2009
A new C++0x feature called a class member initializer allows you to specify a single initializer in the very declaration of a data member. Learn how to use this feature to simplify your constructors' code, reduce potential bugs, and make your code more readable.
February 12, 2009
An abstract base class from which concrete classes are derived is a very common idiom in object-oriented code. So common indeed that a special design pattern called Factory was devised to simplify the runtime creation of derived objects. Learn how Factory can boost your code's reliability and performance.
January 16, 2009
Experts predict that 2009 will be the year of the functional programming paradigm. The revised and enhanced C++0x lambda expressions syntax provides you with exactly the right tools for painless functional programming. Learn how lambda expressions can boost your code and eliminate tedious manual coding.
December 11, 2008
Prior to C++0x, multithreaded C++ applications relied on platform-specific features that were neither portable nor easy to grasp. C++0x fixes this omission with a new multithreading library. Learn how to use this new library to write portable and clean multithreaded C++ code.
November 13, 2008
Not only does C++98 have four different syntactic forms for initializing class objects, aggregates, char arrays and scalar types, it doesn't let you initialize member arrays and dynamically allocated arrays at all. Learn how C++0x fixes these flaws with a uniform and intuitive initialization syntax.
October 9, 2008
Conversion functions are inherently unsafe as they might surprise you with implicit conversions over which you have no control. This is why such functions have been avoided for years. Learn how the new C++0x explicit conversion functions put an end to years of conversion functions blues.
September 11, 2008
C++0x now offers a safer and extremely versatile smart pointer class called std::unique_ptr. Learn how to implement strict ownership semantics with unique_ptr and benefit from its diverse services—customized deleters, safe usage with containers and algorithms, and array handling.
July 10, 2008
C++03 offers no portable mechanism for querying the alignment of a certain type, let alone overriding the default alignment. This vexing state of affairs is about to change with the addition of two new built-in operators to C++0x.
June 12, 2008
C++ has rigid rules regarding the automatic generation of the four canonical member functions. Overriding these rules hasn't been possible thus far. However, the new C++09 defaulted functions give you more control over the compiler's generated canonical functions.
June 3, 2008
When the C# compiler compiles the binary + operator with at least one operand of type string, it causes problems with your <totalNumber>. Find out how to manipulate your strings around this bug.
May 8, 2008
The funky syntax of a function's return type isn't just unreadable in many cases—it's also a common source of maintenance problems. However, with the new decltype operator your functions will look much cleaner and easier to maintain.
April 10, 2008
Tired of typing unwieldy type names in variable declarations? Why not let the compiler do that dirty job, automatically deducing the type from the variable's initializer?
March 13, 2008
Static data is shared among all threads of the same process. This can lead to race-conditions and bugs, but at last there's a solution: use thread-local storage to allocate per-thread data.
February 14, 2008
C++ doesn't offer a direct mechanism for blocking undesirable copying or preventing implicit conversion of arguments. However, with some code tweaks you can work around these problems.
January 10, 2008
The tedium, security hazards, and adverse performance effects of using a pair of iterators to designate the beginning and end of a sequence can all be avoided by switching to ranges—objects that bundle pairs of iterators.
December 13, 2007
Puzzled by indecipherable template compilation errors? Still struggling in vein to enforce restrictions on template parameters? It's time you migrated C++09 concepts!
November 8, 2007
If your apps use complex arithmetic, there's no need to reinvent the wheel. The standard <complex> library is an intuitive, portable, and efficient solution.
August 8, 2007
Whether you're using NULL or 0, your C++ apps are subjected to bugs and maintenance problems that are caused by the ambiguity of 0. Find out how to use the nullptr keyword instead of 0 to indicate a null pointer value.
May 10, 2007
Despite the many instances of copy operations at your disposal, experience the efficiency of a new, emerging paradigm called move semantics.
April 12, 2007
The C++09 standard is about to add two new character datatypes. Find out how you can use them to easily manipulate Unicode Strings.
March 15, 2007
Confused by the recent changes in the Daylight Saving Time scheme? Learn about the ramifications of these changes and find out how to access your system's Daylight Savings Time information programmatically.
February 7, 2007
Applications that display time and date often use tedious manual string formatting operations, making customization an ornery task. The problem is further aggravated when your app undergoes internationalization and localization. Find out how <ctime>'s strftime() function eases your time and date formatting pain.
January 17, 2007
You can build small and medium-sized Java applications faster than you ever dreamed using this complete, out-of-the-box, downloadable project template. With menus and standard UI widgets built in, you'll soon be in point-and-click bliss.
January 11, 2007
Find out how the newly standardized strongly-typed enum types resolve long-standing bugs and security loopholes.
December 7, 2006
There are const variables that arean't constant expressions; there are also constant expressions that don't have an overt const qualifier. Confused? Knowing the rules will help you avoid common mishaps.
November 9, 2006
Recently, the standardization committee approved a proposal to add delegating constructors to C++. Learn how to use the delegating constructor to simplify the design of multi-constructor classes, reduce code reduplication, and eliminate bugs.
October 12, 2006
Have you been beaten by the argument forwarding bug? Are you frustrated by the inability to create containers of references in C++98? Find out how the reference wrapper mini-library cures these ailments.
September 14, 2006
The recently standardized std::tr1::function class template is a generic callback mechanism with intuitive and uniform syntax and semantics. This generalized abstraction mechanism encapsulates any callable entity—regardless of its underlying implementation. Learn how to use this class to simplify your code and expand your design choices.
August 9, 2006
Have you given up implicit conversions to bool because of the bugs they cause? Find out how the "indirect conversion" idiom can help you thwart undesirable conversions while still permitting well-behaved conversions.
July 13, 2006
Java and C# have keywords that allow you to disable inheritance, but C++ does not. Find out how you can still prevent undesirable inheritance from concrete classes and how you can disable the copying of objects that aren't meant to be copied.
June 7, 2006
Controlling the number of fractional digits after the decimal point is a common requirement in various application domains, but floating point variables don't support this directly. How do you still keep your floating point data neatly formatted? The answer lies in converting them to strings and formatting their textual representation.
May 11, 2006
Embedding a hard-coded string inside a function's body in order to retrieve that function's name can be tedious and bug-prone. Learn how to use a new C99 facility to obtain the function's name at runtime.
April 11, 2006
virtual member functions are widely used in object-oriented design but they don't always give you the flexibility you're after. For example, they don't let a derived class modify certain steps of a base class function while still retaining the original structure of the base class function. Learn how the Template design pattern solves this problem neatly.
March 27, 2006
Every Web developer has to tangle with tables. A new open source library, DisplayTag, can make life with tables much more organized. Find out how to combine the DisplayTag library with JavaScript to make a slick app that displays line item details.
March 15, 2006
Each built-in datatype in C++ possesses different properties, all of which contain a wealth information important to the design of your application. Find out how the <limits> library can help you programmatically access this critical data.
February 9, 2006
Learn how to allocate arrays of objects on a predetermined memory address using this unusual twist on placement new.
January 12, 2006
You can declare classes and functions friends, but the unfriendly syntax may bewilder you—particularly if you're using them in templates. Learn some simple guidelines and rules to tame friend declarations and make them do precisely what you want them to.
December 21, 2005
Writing stored procedures (SPs) from scratch is boring and time consuming. Some tools may do it for you, but we all have our coding styles. Learn how to generate SPs the way you like best.
December 8, 2005
Developing financial, scientific, or numerical analysis applications? Tired of reinventing the wheel when it comes to calculating basic statistical data? Find out how you can implement statistical functions with a few useful STL algorithms.
November 10, 2005
C++ has come a long way, but using heterogeneous containers can still be a hassle. Find out how the Boost.Any library provides a new way to safely store objects of arbitrary datatypes in a container.
October 12, 2005
How do you trim a container whose capacity is larger than necessary? How do you force a container to destroy its elements and set its capacity to 0? Find out how to regulate an STL container's storage manually.
September 6, 2005
Learn how to simulate the implicit conversion of built-in datatypes with different specializations of the same template by adding an asymmetric assignment operator to the class template.
August 11, 2005
Though the changes in Visual Studio 2005 represent a major improvement over non-compliant hacks that have been in use since the mid-1990s, fear of breaking existing C++ apps has led many project managers to avoid upgrading. This checklist helps you to locate and repair incompliant code so you can upgrade your apps--without breaking them.
July 13, 2005
Defining an unnamed function directly on the call site of an algorithm can be very useful but is it even possible? Yes it is! Find out how using lambda expressions can simplify your use of STL algorithms.
June 8, 2005
Your days of being frustrated by std::auto_ptr's limitations are over. The Library Extensions Technical Report 1 has added a new smart pointer class to the standard <memory> header. Find out how you can use shared_ptr to automate resource management and simplify common programming tasks.
February 8, 2005
Built-in arrays provide superior performance, but the trick is to use them without compromising STL compatibility. This solution will teach you to use built-in arrays properly and how to create an array whose dimensions are determined at runtime without having to resort to hefty dynamic memory allocation.
February 2, 2005
Some fundamental principles apply to game programming regardless of the language you use to create the game. These principles include gathering input from users, processing game data, and rendering game objects to the screen. This article shows you how to use JavaScript to program a simple game.
January 26, 2005
Incremental software upgrades can be a nightmare if they're not managed in an orderly and logical fashion. Learn how to simplify the registration of multiple DLLs from any location.
January 12, 2005
Because standard C++ doesn't have a library for manipulating directories, programmers are forced to use workarounds that waste their time and compromise code portability. Thankfully, you can use the quasi-standard <dirent.h> and <dir.h> libraries to manipulate directories in a portable and platform-neutral fashion.
advertisement
advertisement
advertisement
Sitemap