From f91e7e9ce77c852a5cb8998f5b7749d5ba42dfa2 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Wed, 29 Jan 2014 09:15:47 -0800 Subject: [PATCH] Minor documentation corrections --- make_unique.html | 14 +++++++------- smart_ptr.htm | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/make_unique.html b/make_unique.html index b6d7a7d..ab4db62 100644 --- a/make_unique.html +++ b/make_unique.html @@ -13,9 +13,9 @@ Examples
History

Introduction

-

The header file <boost/make_unique.hpp> provides a family of - overloaded function template make_unique for convenient - creation of unique_ptr objects.

+

The header file <boost/make_unique.hpp> provides overloaded + function template make_unique for convenient creation of + unique_ptr objects.

Synopsis

namespace boost {
     template<typename U> // U is not array
@@ -69,20 +69,20 @@ unique_ptr<U> make_unique_noinit();
template<typename U> // U is T[]
 unique_ptr<U> make_unique(size_t size);
-

Requires: The expression new U() shall be +

Requires: The expression new T[size]() shall be well-formed.

Effects: Constructs an array of objects of type U and size size via the expression - new U[size]().

+ new T[size]().

template<typename U> // U is T[]
 unique_ptr<U> make_unique_noinit(size_t size);
-

Requires: The expression new U shall be +

Requires: The expression new T[size] shall be well-formed.

Effects: Constructs an array of objects of type U and size size via the expression - new U[size].

+ new T[size].

Examples

For objects with value-initialization.

diff --git a/smart_ptr.htm b/smart_ptr.htm index c16dceb..3956aaf 100644 --- a/smart_ptr.htm +++ b/smart_ptr.htm @@ -62,7 +62,7 @@ described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition, Section 14.4, Resource Management.

Additionally, the smart pointer library provides efficient factory functions - for creating shared_ptr objects:

+ for creating smart pointer objects:

@@ -137,8 +137,9 @@ throwing exceptions by the common requirements.

History and Acknowledgements

January 2014. Glen Fernandes confined the overloads of make_shared - and allocate_shared for arrays to the specification in N3870 and - implemented make_unique for arrays and objects.

+ and allocate_shared for arrays to the specification in + N3870 + and implemented make_unique for arrays and objects.

November 2012. Glen Fernandes provided implementations of make_shared and allocate_shared for arrays. They achieve a single allocation for an array that can be initialized with constructor arguments or initializer lists