Skip to content

Conversation

fktn-k
Copy link
Owner

@fktn-k fktn-k commented Dec 7, 2024

This PR adds the following changes:

  • The following legacy container types are added to the basic_node template class as its member types.
    The iterator and const_iterator of basic_node refer to them when instantiating their types.
    name description associated type
    value_type type of elements of a container node basic_node
    reference type of reference to an element of a container node basic_node&
    const_reference type of const reference to an element of a container node const basic_node&
    pointer type of pointer to an element of a container node basic_node*
    const_pointer type of const pointer to an element of a container node const basic_node*
    size_type type to represent container node sizes std::size_t
    size_type type to represent differences between elements of a container node std::ptrdiff_t
  • basic_node's iterator and const_iterator objects are now compatible regarding:
    • copy construction/assignment
      • const_iterator objects still cannot be assigned to or used for constructing iterator objects so the const-ness of const_iterator is not casted away.
    • relational comparisons
      • operator==, operator!=
      • operator<, operator<=, operator>, operator>=
  • New member functions cbegin() and cend() are added to basic_node.
    They always return a const_iterator object to the first and past-the-last element respectively just like those provided in STL container types.

The test suite and the API documentation contents have also been updated according to the above changes.


Pull Request Checklist

Read the CONTRIBUTING.md file for detailed information.

  • Changes are described in the pull request or in a referenced issue.
  • The test suite compiles and runs without any error.
  • The code coverage on your branch is 100%.
  • The documentation is updated if you added/changed a feature.

Please don't

  • The C++11 support varies between different compilers and versions. Please note the list of supported compilers. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with #ifdefs or other means.
  • Please refrain from proposing changes that would break YAML specifications. If you propose a conformant extension of YAML to be supported by the library, please motivate this extension.
  • Please do not open pull requests that address multiple issues.

@fktn-k fktn-k added improvement refactoring or optimization without public API changes new feature new feature possibly with public API changes labels Dec 7, 2024
@fktn-k fktn-k added this to the Release v0.4.0 milestone Dec 7, 2024
@fktn-k fktn-k self-assigned this Dec 7, 2024
Copy link

github-actions bot commented Dec 7, 2024

:octocat: Upload Coverage Event Notification

Coverage data has been uploaded for the commit 12022b71267e01932167ed6a729f8b4210d2ddfd.
You can download the artifact which contains the same file uploaded to the Coveralls and its HTML version.

Name fkYAML_coverage.pr438.zip
ID 2288200240
URL https://github.com/fktn-k/fkYAML/actions/runs/12210738151/artifacts/2288200240

@fktn-k fktn-k changed the title Make node iterators compatible with iterators of different const-ness in their value types Make node iterators compatible with different value type const-ness Dec 7, 2024
@fktn-k fktn-k merged commit 02d8c66 into develop Dec 7, 2024
163 checks passed
@fktn-k fktn-k deleted the compare_iterators_with_different_constness branch December 7, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement refactoring or optimization without public API changes new feature new feature possibly with public API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant