Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add immuds port #42335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add immuds port #42335

wants to merge 1 commit into from

Conversation

vlad-dobrescu
Copy link

@vlad-dobrescu vlad-dobrescu commented Nov 23, 2024

This PR adds a new port: immuds, a header-only immutable data structures library.

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed library includes a "copyright" file that matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

Notes

  • immuds is a header-only library, so no linking is required. It provides immutable data structures for C++ developers.
  • The library is compatible with all major platforms supported by vcpkg and has no optional dependencies.

Available Headers

The library provides the following immutable data structure implementations:

  • immutable/Stack.h: A stack implementation that returns new instances upon modification.
  • immutable/PriorityQueue.h: A priority queue implementation.
  • immutable/Queue.h: A queue implementation.
  • immutable/Set.h: A set implementation.
  • immutable/HashMap.h: A hash map implementation.

Usage Instructions

After installing via vcpkg:

./vcpkg install immuds

To use it in your CMake project, follow these steps:

  1. Include the vcpkg toolchain in your project configuration:

    set(CMAKE_TOOLCHAIN_FILE "/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake")
  2. Find and include the immuds headers:

    find_path(IMMUDS_INCLUDE_DIRS "immutable/HashMap.h")
    target_include_directories(main PRIVATE ${IMMUDS_INCLUDE_DIRS})
  3. Write a C++ program that uses the library:

    #include <immutable/HashMap.h>
    
    int main() {
    
         immutable::Stack<int> stack;
         stack = stack.push(3);
         stack = stack.push(11);
         std::cout<<stack.top();
         stack = stack.pop();
        return 0;
    }

@vlad-dobrescu
Copy link
Author

@microsoft-github-policy-service agree

@jimwang118 jimwang118 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants