llvm-capstone/libcxx/docs
Nico Weber 1362d7ef88 libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions
This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT
to 37 more functions, namely:

adjacent_find, all_of, any_of, binary_search, clamp, count_if, count,
equal_range, equal, find_end, find_first_not_of, find_first_of, find_if,
find, includes, is_heap_until, is_heap, is_partitioned, is_permutation,
is_sorted_until, is_sorted, lexicographical_compare, lower_bound,
max_element, max, min_element, min, minmax_element, minmax, mismatch,
none_of, remove_if, remove, search_n, search, unique, upper_bound

The motivation here is that we noticed that find_if is nodiscard with
Visual Studio's standard library, and we deemed that useful
(https://crbug.com/948122).
https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/
says "Our criteria for emitting the warning are: discarding the return
value is a guaranteed leak [...], discarding the return value is
near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or
the function is essentially a pure observer (e.g. vector::empty() and
std::is_sorted())." so I went through algorithm and tried to apply these
criteria.

Some of these, like vector::empty() are already nodiscard per C++
standard and didn't need changing.

I didn't (yet?) go over std::string::find* methods which should probably
have _LIBCPP_NODISCARD_EXT too (but not as part of this change).

Differential Revision: https://reviews.llvm.org/D60145

llvm-svn: 357619
2019-04-03 18:13:08 +00:00
..
DesignDocs [libcxx] Start defining lit features for tests depending on availability 2019-02-05 19:22:38 +00:00
BuildingLibcxx.rst Allow disabling of filesystem library. 2019-03-21 00:04:31 +00:00
CMakeLists.txt docs: Fix Sphinx detection with out-of-tree builds 2017-05-09 11:18:03 +00:00
conf.py Bump the trunk version to 9.0.0svn 2019-01-16 10:57:02 +00:00
FeatureTestMacroTable.rst Implement feature test macros using a script. 2019-01-16 01:37:43 +00:00
index.rst [libc++][CMake] Clean up some of the libc++ re-exporting logic 2019-03-20 18:16:24 +00:00
Makefile.sphinx Add design docs for upcoming file_time_type change. 2018-07-25 02:53:53 +00:00
README.txt Remove test commit. 2015-09-05 05:38:50 +00:00
ReleaseNotes.rst Bump the trunk version to 9.0.0svn 2019-01-16 10:57:02 +00:00
TestingLibcxx.rst [CMake] Support compiler-rt builtins library in tests 2019-02-05 19:50:47 +00:00
UsingLibcxx.rst libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions 2019-04-03 18:13:08 +00:00

libc++ Documentation
====================

The libc++ documentation is written using the Sphinx documentation generator. It is
currently tested with Sphinx 1.1.3.

To build the documents into html configure libc++ with the following cmake options:

  * -DLLVM_ENABLE_SPHINX=ON
  * -DLIBCXX_INCLUDE_DOCS=ON

After configuring libc++ with these options the make rule `docs-libcxx-html`
should be available.