From a34409a2ae1aa72fe19cc2585b562467628a57d8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 2 Dec 2017 10:19:23 -0800 Subject: [PATCH] Update paper --- Text Formatting.html | 56 ++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/Text Formatting.html b/Text Formatting.html index cf81d2b8..8026af54 100644 --- a/Text Formatting.html +++ b/Text Formatting.html @@ -1078,6 +1078,8 @@

Formatting argument

template <class Context> class basic_arg { public: + class handle; + basic_arg(); explicit operator bool() const noexcept; @@ -1089,10 +1091,10 @@

Formatting argument

-An object of type basic_arg<Context> represents a reference -to a formatting argument parameterized on a formatting context (see -3.9). It can hold a value of one of the following -types: +The class template basic_arg describes objects that store a copy of +or a reference to a formatting argument. It is parameterized on a formatting +context (see 4.9) and can hold a value of one of the +following types:

@@ -1131,12 +1132,13 @@

Formatting argument

bool is_integral() const;

Returns: true if *this represents an -argument of an integral type.

+argument of an integral type ([basic.fundamental]).

bool is_numeric() const;

Returns: true if *this represents an -argument of a numeric type.

+argument of an integral or a floating-point type.

bool is_pointer() const;
@@ -1150,6 +1152,24 @@

Formatting argument

the number of possible value types of a formatting argument.

+
+template <class Context>
+class basic_arg<Context>::handle {
+public:
+  using char_type = typename Context::char_type;
+
+  void format(basic_buffer<char_type>& buf, Context& ctx);
+};
+
+ +
+
void format(basic_buffer<char_type>& buf, Context& ctx);
+
+

Effects: Formats the object referred to by this handle into the buffer +buf. +

+
+

Formatting argument visitation

@@ -1336,7 +1356,7 @@

Formatting context

using char_type = charT; using args_type = basic_args<basic_context>; - basic_context(const charT* format_str, args_type args); + basic_context(args_type args); args_type args() const; };
@@ -1344,17 +1364,17 @@

Formatting context

The class basic_context represents a formatting context for -user-defined types. It provides access to formatting arguments and the current -position in the format string being parsed. +user-defined types. It can be used to implement different types of formatters, +e.g. a printf formatter.

-
basic_context(const charT* format_str, args_type args);
+
basic_context(args_type args);

Effects: Constructs an object of class basic_context -storing references to the formatting arguments and the format string in it. +storing references to the formatting arguments.

-

Postcondition: ptr() == format_str.

+

Postcondition: args() == args.

args_type args() const;
@@ -1536,7 +1556,7 @@

User-defined types

 template <class T, class charT = char>
 struct formatter {
-  constexpr typename basic_parse_context<charT>::iterator parse(parse_context<charT>& ctx);
+  constexpr typename basic_parse_context<charT>::iterator parse(basic_parse_context<charT>& ctx);
   void format(basic_buffer<charT>& buf, const T& value, basic_context<charT>& ctx);
 };