GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing cpppatterns.com — C++ Patterns Featured pattern: Weak reference
Requires
c++11
or newer
IntentMaintain a non-owning reference to a shared dynamically allocated object to break circular dependencies. DescriptionThe All patternsAlgorithmsCopy a range of elements
Requires
c++11
or newer
Copy elements from a range to another range or container. Count occurrences of value in a range
Requires
c++98
or newer
Count the number of occurrences of a particular value in a range of elements. ClassesCopy-and-swap
Requires
c++11
or newer
Implement the assignment operator with strong exception safety. Delegate behavior to derived classes
Requires
c++98
or newer
Delegate behavior to derived classes without incurring the cost of run-time polymorphism. Lexicographic ordering
Requires
c++11
or newer
Implement a lexicographic ordering over class members. Non-member non-friend interfaces
Requires
c++98
or newer
Reduce dependencies on internal class details and improve encapsulation. The PIMPL idiom
Requires
c++11
or newer
Remove compilation dependencies on internal class implementations and improve compile times. The rule of five
Requires
c++11
or newer
Safely and efficiently implement RAII to encapsulate the management of dynamically allocated resources. The rule of zero
Requires
c++98
or newer
Utilise the value semantics of existing types to avoid having to implement custom copy and move operations. Virtual constructor
Requires
c++11
or newer
Create a copy of an object through a pointer to its base type. ConcurrencyPass values between threads
Requires
c++11
or newer
Use promises to communicate values between threads. ContainersCheck existence of a key
Requires
c++11
or newer
Check if a particular key is in an associative container. Remove elements from a container
Requires
c++11
or newer
Use the erase-remove idiom to remove elements from a container. FunctionsOptional arguments
Requires
c++17
or newer
Allow argument values to be omitted when calling a function. Return multiple values
Requires
c++11
or newer
Return multiple values of different types from a function. Input streamsRead a line of values
Requires
c++98
or newer
Read a sequence of delimited values from a single line of an input stream into a standard container. Validate multiple reads
Requires
c++98
or newer
Ensure that multiple stream reads are successful before using the extracted values. Memory managementShared ownership
Requires
c++11
or newer
Share ownership of a dynamically allocated object with another unit of code. Unique ownership
Requires
c++11
or newer
Transfer unique ownership of a dynamically allocated object to another unit of code. Use RAII types
Requires
c++98
or newer
Avoid manual memory management to improve safety and reduce bugs and memory leaks. Weak reference
Requires
c++11
or newer
Maintain a non-owning reference to a shared dynamically allocated object to break circular dependencies. Output streamsWrite data in columns
Requires
c++98
or newer
Align data in columns when writing to an output stream. Random number generationFlip a biased coin
Requires
c++11
or newer
Generate a random boolean value according to a bernoulli distribution. Unpredictable random numbers
Requires
c++11
or newer
Seed a random number engine with greater unpredictability. RangesRange-based algorithms
Requires
c++11
or newer
Implement algorithms that can be applied to any generic range of elements. Range iteration
Requires
c++11
or newer
Iterate over a range of elements without using iterators or indices. TemplatesClass template SFINAE
Requires
c++11
or newer
Conditionally instantiate a class template depending on the template arguments. Function template SFINAE
Requires
c++11
or newer
Conditionally instantiate a function template depending on the template arguments. Perfect forwarding
Requires
c++11
or newer
Forward arguments of one function to another as though the wrapped function had been called directly. TimeFixed time step
Requires
c++11
or newer
Block the execution of a thread until a fixed point in time. BehavioralCreational
← All patterns
Search Results | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |