C++中重要的头文件与命名空间

1) IO

#include <iostream>           // std::cin,     std::cout,    std::ios

#include <sstream>



2) 字符串

using namespace std::string_literals;         //

using namespace std::string_view_literals;

#include <string>     //  std::char_traits<char>::length


https://www.pudn.com/news/628dd3629ca87e087f5ce3e1.html



3) 正则表达式

#include <regex>   // std::regex_match  std::regex_search  std::regex_replace



https://chocolate.blog.csdn.net/article/details/100780910


4) 集合

#include <vector>

#include <map>

#include <set>

#include <tuple>


http://c.biancheng.net/stl/


5) 通用类型

#include <variant>     //  std::variant     std::get    std::holds_alternative   std::visit
#include <any>          //  std::any    std::any_cast
#include <optional>    //  std::optional   std::get_if

#include <utility>        // std::swap  std::forward  std::move  std::pair  std::make_pair 

                                       // std::tuple  std::get  std::tuple_size  std::tuple_element

#include <memory>      //  std::addressof    std::unique_ptr    std::shared_ptr    std::weak_ptr   

                                           // std::dynamic_pointer_cast   std::reinterpret_pointer_cast 


#include <type_traits>   // std::aligned_union


https://blog.csdn.net/alexhu2010q/article/details/117575655


6) 算法

#include <iterator>

         // std::begin  std::cbegin  std::end  std::cend  std::rbegin  std::crbegin  std::rend  std::crend   // 获取集合的迭代器
  
         // std::reverse_iterator  std::move_iterator  std::back_insert_iterator  std::front_insert_iterator std::insert_iterator   
         // std::inserter  std::back_inserter  std::front_inserter  std::make_reverse_iterator  std::make_move_iterator

         // std::istream_iterator   std::ostream_iterator   std::istreambuf_iterator   std::ostreambuf_iterator   // 获取流的迭代器

         // std::next  std::prev  std::distance  std::advance   // 移动迭代器
        // std::size  std::ssize  std::empty  std::data
   // 获取集合的特性


#include <algorithm>

         // std::for_each  std::for_each_n  // 遍历

         // std::count  std::count_if  std::max  std::max_element  std::minmax  std::minmax_element  std::clamp

         // std::find  std::find_if  std::find_if_not  std::find_end  std::find_first_of   // 查找
         // std::search  std::search_n
         // std::mismatch
         // std::adjacent_find   

         // std::copy  std::copy_if  std::copy_n  std::copy_backward   // 复制集合中元素
         // std::move  std::move_backward   // 将集合中元素移动到另一个集合中
         // std::fill  std::fill_n  // 用某个值填充集合中元素
         // std::transform   // 对集合中元素进行变换操作
         // std::generate  std::generate_n  //  生成集合
         // std::remove  std::remove_if  std::remove_copy  std::remove_copy_if  // 删除集合中元素
         // std::replace  std::replace_if  std::replace_copy  std::replace_copy_if   // 替换集合中元素
         // std::swap  std::swap_ranges  std::iter_swap   // 交换两个对象的值
         // std::reverse  std::reverse_copy  //  颠倒集合中元素
         // std::rotate  std::rotate_copy
         // std::shuffle  std::random_shuffle
         // std::sample
         // std::unique  std::unique_copy  // 删除集合中重复元素

         // std::partition  std::partition_copy  std::stable_partition  // 将集合中元素进行分组

         // std::sort  std::partial_sort  std::partial_sort_copy  std::stable_sort  std::nth_element  std::is_sorted  // 排序

         // std::binary_search  std::lower_bound  std::upper_bound   // 二分查找

         // std::sort_heap  std::make_heap  std::push_heap  std::pop_heap  std::is_heap  std::is_heap_until   // 堆

         // std::merge  std::inplace_merge   // 融合两个有序集合

         // std::includes  std::set_difference  std::set_intersection  std::set_symmetric_difference  std::set_union  // 集合操作


#include <functional>     //  std::ref   std::cref   std::function   std::mem_fn 

                                           //  std::hash   std::reference_wrapper   std::bind   std::invoke 



7) 异常

#include <stdexcept>   // std::runtime_error   std::overflow_error

#include <exception>     // std::exception,   std::current_exception


https://blog.csdn.net/panyong6216/article/details/115185934


8) 多线程

#include <thread>        // thread_local  std::thread    std::this_thread
#include <future>        // std::promise,   std::future, std::packaged_task,   std::shared_future,   std::launch,   std::async

#include <mutex>     // std::mutex   std::recursive_timed_mutex   std::lock_guard   std::unique_lock   std::scoped_lock

#include <condition_variable>     // std::condition_variable  std::condition_variable_any

#include <atomic>    // std::atomic   std::memory_order_relaxed



9) 时间

using namespace std::chrono_literals;

#include <chrono>   // std::chrono::seconds(5)

#include <time.h>

#include <ctime>


https://blog.csdn.net/hhy321/article/details/125816701


20) 字面量

https://www.modb.pro/db/558712


----------------------------------------------------------------------

posted @ 2022-12-23 10:36  ParamousGIS  阅读(192)  评论(0编辑  收藏  举报