Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
CAN/CSA ISO/IEC TR 19768-08 (R2018) is the Canadian Standards Association (CSA) adoption of the international ISO/IEC TR 19768, titled “Information technology — Programming languages — C++ — Library Extensions”. Originally published in 2007 and reaffirmed in 2018, this Technical Report—commonly known as TR1 (Technical Report 1)—served as the foundation for many features later integrated into the C++11 standard. The Canadian adoption preserves the entire content of the international technical report while aligning it with the Canadian regulatory framework for ICT systems.
The scope of this document is limited to library extensions for the C++ programming language. It does not modify the core language itself; rather, it introduces a set of new components for the C++ standard library, including utilities for type traits, function binders, and sophisticated resource management tools. The primary objective is to provide a stable reference for implementers, compiler vendors, and software developers who require a well-defined, backwards-compatible library enhancement path before the publication of C++11.
std::tr1::shared_ptr and std::tr1::array—were later moved to std:: and widely adopted. Understanding TR1 is still valuable for maintaining legacy systems that target pre-C++11 environments. TR1 defines a set of library additions that reside in the std::tr1 namespace. The standard mandates specific functional requirements, interfaces, and behavioral guarantees for each component. Below is a summary of the major categories covered by CAN/CSA ISO/IEC TR 19768-08.
shared_ptr and weak_ptr for automatic memory management with reference counting and weak references.function for type-erased callables, bind for argument binding, and mem_fn for wrapping member pointers.is_integral, remove_reference), laying the foundation for template metaprogramming.tuple class template for fixed-size heterogeneous collections of types.array container (fixed-size stack-allocated array with STL-compatible interface).unordered_map, unordered_set, unordered_multimap, unordered_multiset based on hash tables.ratio.regex library (based on ECMAScript syntax) for pattern matching and string replacement.move semantics support.Although the TR1 predates the full C++11 memory model, it introduced preliminary building blocks for concurrency, such as the low-level atomic for lock-free integer operations. These were later superseded by the more comprehensive std::atomic facilities in C++11.
std::shared_ptr over std::tr1::shared_ptr to benefit from the later concurrency guarantees. | Component | Header | Namespace | Origin / Status |
|---|---|---|---|
shared_ptr | <memory> | std::tr1 | From Boost; adopted into C++11 with minor changes |
weak_ptr | <memory> | std::tr1 | From Boost; preserved in C++11 |
function | <functional> | std::tr1 | Polymorphic function wrapper; part of C++11 |
bind | <functional> | std::tr1 | Argument binding; superseded by std::bind in C++11 |
array | <array> | std::tr1 | Standardized in C++11 |
unordered_map | <unordered_map> | std::tr1 | Hash table; replaced hash_map extensions |
regex | <regex> | std::tr1 | Standardized in C++11 with minor changes |
tuple | <tuple> | std::tr1 | From Boost; adopted in C++11 |
type_traits | <type_traits> | std::tr1 | Fully integrated into C++11 |
random | <random> | std::tr1 | Engine + distribution model; C++11 compatible |
Implementing CAN/CSA ISO/IEC TR 19768-08 requires adherence to the interface and behavioral specifications defined in the technical report. Compiler vendors typically provide TR1 support through a separate header and namespace (<tr1/…> or std::tr1). The table above summarises the origin and eventual standardisation of each component. For developers, the following best practices are recommended when working with TR1:
std::tr1::shared_ptr only when compiling with a pre‑C++11 toolchain. For new projects that target C++11 or later, always use the std:: versions. If you must support both standards, consider using a compatibility wrapper such as BOOST_CPP11 defines or the std::shared_ptr fallback. std::tr1:: with std::. However, some components (e.g., bind) had slight changes in semantics; verify affected code thoroughly.std::tr1::regex behavior with edge cases (e.g., nested captures, back-references) before relying on it in production code. Compliance with CAN/CSA ISO/IEC TR 19768-08 is assessed based on a set of documented requirements. For organizations seeking certification (e.g., for federal ICT projects in Canada or for conformance with a corporate coding standard), the following principles apply:
std::tr1::shared_ptr or std::shared_ptr in a project that must compile both C++03 and C++11?#if __cplusplus >= 201103L to select std::shared_ptr; otherwise fall back to std::tr1::shared_ptr. This approach avoids namespace ambiguity and ensures you get the thread-safety improvements of the C++11 version when available. This article is intended for general informational purposes and should not be used as a substitute for the official standard text. Always consult the latest adopted version of CAN/CSA ISO/IEC TR 19768-08 for precise technical and legal requirements.