/cpp_knowledge_sharing

Cpp related knowledge, powered by ChatGPT4.

Primary LanguageHTML

Cpp Knowledge Sharing

Cpp related knowledge, powered by ChatGPT4. Contents are all in English. >w< Enjoy!

Keywords

STL

These are very powerful when trying to write efficient programs. Know their existence and use them when in handy, and this will save us lots of efforts.

Note that here's just the tip of the iceberg. For more information, you may refer to here: https://en.cppreference.com

for mathematic functions in , see: https://en.cppreference.com/w/cpp/header/cmath

std::execution

std::move

  • find_end

    Find last subsequence in range (function template)

  • find_first_of

    Find element from set in range (function template)

  • adjacent_find

    Find equal adjacent elements in range (function template)

  • count

    Count appearances of value in range (function template)

  • count_if Return number of elements in range satisfying condition (function template)

  • mismatch

    Return first position where two ranges differ (function template)

  • equal

    Test whether the elements in two ranges are equal (function template)

  • is_permutation

    Test whether range is permutation of another (function template)

  • search

    Search range for subsequence (function template)

  • search_n

    Search range for elements (function template)

  • copy_if

  • copy_backward

  • move_backward

    Move range of elements backward (function template)

  • swap

    Exchange values of two objects (function template)

  • swap_ranges

    Exchange values of two ranges (function template)

  • iter_swap

    Exchange values of objects pointed to by two iterators (function template)

  • replace

    Replace value in range (function template)

  • replace_if

    Replace values in range (function template)

  • replace_copy

    Copy range replacing value (function template)

  • replace_copy_if

    Copy range replacing value (function template)

  • fill

    Fill range with value (function template)

  • fill_n

    Fill sequence with value (function template)

  • generate

    Generate values for range with function (function template)

  • generate_n

    Generate values for sequence with function (function template)

  • remove

    Remove value from range (function template)

  • remove_if

    Remove elements from range (function template)

  • remove_copy

    Copy range removing value (function template)

  • remove_copy_if

    Copy range removing values (function template)

  • unique Remove consecutive duplicates in range (function template)

  • unique_copy

    Copy range removing duplicates (function template)

  • reverse Reverse range (function template)

  • reverse_copy

    Copy range reversed (function template)

  • rotate

    Rotate left the elements in range (function template)

  • rotate_copy

    Copy range rotated left (function template)

  • random_shuffle

    Randomly rearrange elements in range (function template)

  • shuffle

    Randomly rearrange elements in range using generator (function template)

  • is_partitioned

    Test whether range is partitioned (function template)

  • partition_point

    Get partition point (function template)

  • equal_range Get subrange of equal elements (function template)

  • binary_search

  • merge

    Merge sorted ranges (function template)

  • inplace_merge

    Merge consecutive sorted ranges (function template)

  • includes

    Test whether sorted range includes another sorted range (function template)

  • set_union

    Union of two sorted ranges (function template)

  • set_intersection

    Intersection of two sorted ranges (function template)

  • set_difference

    Difference of two sorted ranges (function template)

  • set_symmetric_difference

    Symmetric difference of two sorted ranges (function template)

  • lexicographical_compare

    Lexicographical less-than comparison (function template)

  • next_permutation

    Transform range to next permutation (function template)

  • prev_permutation

Template

Just some basic ideas. It doesn't cover Template Metaprogramming.

For that please refer to: CppTemplateTutorial

Features and Techniques

Interesting Questions

Courses

CS106L

Official website: http://web.stanford.edu/class/cs106l/

And also my implementation

CS106L includes just basic C++ knowledge. >w<

Think the mannual's great. Haven't read it though(.

MPCS 51044&5

Official website: https://mpcs-courses.cs.uchicago.edu/2022-23/spring/courses/mpcs-51045-1

Advanced cpp course from Uchicago.

Password: [mac login]

References

https://learn.microsoft.com/en-us/cpp/cpp

https://github.com/Light-City/CPlusPlusThings

https://en.cppreference.com

https://github.com/wuye9036/CppTemplateTutorial

TODO

IEEE 754

https://learn.microsoft.com/en-us/cpp/cpp/keywords-cpp?view=msvc-170

for_each, the default traversal algorithm (along with range-based for loops).

find_if, the default search algorithm.

functors

reading lastly left here:

https://learn.microsoft.com/en-us/cpp/cpp/temporary-objects?view=msvc-170

STL: group functions by headers

pod:https://zhuanlan.zhihu.com/p/45545035