Update documentation

This commit is contained in:
Peter Dimov
2021-09-19 03:37:51 +03:00
parent 1f98fab0bf
commit a0d8040e93
4 changed files with 31 additions and 15 deletions

View File

@ -1,5 +1,5 @@
//// ////
Copyright 2019 Peter Dimov Copyright 2019, 2021 Peter Dimov
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt http://www.boost.org/LICENSE_1_0.txt
//// ////
@ -10,6 +10,10 @@ http://www.boost.org/LICENSE_1_0.txt
:toc-title: :toc-title:
:idprefix: :idprefix:
## Changes in 1.78.0
* Added `source_location::to_string`.
## Changes in 1.73.0 ## Changes in 1.73.0
* Added `source_location`. * Added `source_location`.

View File

@ -30,7 +30,7 @@ include::changes.adoc[]
This documentation is This documentation is
* Copyright 2002, 2007, 2014, 2017, 2019, 2020 Peter Dimov * Copyright 2002, 2007, 2014, 2017, 2019-2021 Peter Dimov
* Copyright 2011 Beman Dawes * Copyright 2011 Beman Dawes
* Copyright 2015 Ion Gaztañaga * Copyright 2015 Ion Gaztañaga
* Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0]. * Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0].

View File

@ -1,5 +1,5 @@
//// ////
Copyright 2019 Peter Dimov Copyright 2019, 2021 Peter Dimov
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt http://www.boost.org/LICENSE_1_0.txt
//// ////
@ -36,6 +36,8 @@ struct source_location
constexpr char const* function_name() const noexcept; constexpr char const* function_name() const noexcept;
constexpr uint_least32_t line() const noexcept; constexpr uint_least32_t line() const noexcept;
constexpr uint_least32_t column() const noexcept; constexpr uint_least32_t column() const noexcept;
std::string to_string() const;
}; };
template<class E, class T> template<class E, class T>
@ -67,6 +69,15 @@ Effects: :: Constructs a `source_location` object for which `file_name()`
returns `file`, `function_name()` returns `function`, `line()` returns the returns `file`, `function_name()` returns `function`, `line()` returns the
`line` argument and `column()` returns the `column` argument. `line` argument and `column()` returns the `column` argument.
## to_string
```
std::string to_string() const;
```
Returns: ::
a string representation of `*this`.
## operator<< ## operator<<
``` ```
@ -75,8 +86,9 @@ template<class E, class T>
operator<<( std::basic_ostream<E, T> & os, source_location const & loc ); operator<<( std::basic_ostream<E, T> & os, source_location const & loc );
``` ```
Effects: :: Outputs a string representation of `loc` to `os`. Effects: :: `os << loc.to_string()`.
Returns: :: `os`. Returns: ::
`os`.
## BOOST_CURRENT_LOCATION ## BOOST_CURRENT_LOCATION

View File

@ -1,4 +1,4 @@
// Copyright 2020 Peter Dimov // Copyright 2020, 2021 Peter Dimov
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt // http://www.boost.org/LICENSE_1_0.txt