Code Monkey home page Code Monkey logo

sfl-library's People

Contributors

johannes-wolf avatar slavenf avatar zehmatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sfl-library's Issues

[question] CMake install location

Hello, we are building sfl-library and we found the follow line in the Cmake code:

https://github.com/slavenf/sfl-library/blob/master/CMakeLists.txt#L19

Which results in the follow installation:

% cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/tmp/install2
% cmake --build build --target install 
Install the project...
-- Install configuration: ""
-- Installing: /tmp/install2/include/sfl
-- Installing: /tmp/install2/include/sfl/small_flat_map.hpp
-- Installing: /tmp/install2/include/sfl/small_unordered_flat_multiset.hpp
-- Installing: /tmp/install2/include/sfl/small_flat_multimap.hpp
-- Installing: /tmp/install2/include/sfl/small_unordered_flat_map.hpp
-- Installing: /tmp/install2/include/sfl/small_vector.hpp
-- Installing: /tmp/install2/include/sfl/compact_vector.hpp
-- Installing: /tmp/install2/include/sfl/small_flat_set.hpp
-- Installing: /tmp/install2/include/sfl/segmented_vector.hpp
-- Installing: /tmp/install2/include/sfl/small_unordered_flat_multimap.hpp
-- Installing: /tmp/install2/include/sfl/small_flat_multiset.hpp
-- Installing: /tmp/install2/include/sfl/small_unordered_flat_set.hpp

So, I'm not sure if that's the expected installation tree, because the CMake file is using include as destination. So, adding the follow patch (adding an extra slash):

install(
	DIRECTORY
		include/sfl/
	DESTINATION
		include
)

Will result as:

% cmake --build build --target install 
Install the project...
-- Install configuration: ""
-- Up-to-date: /tmp/install2/include
-- Up-to-date: /tmp/install2/include/small_flat_map.hpp
-- Up-to-date: /tmp/install2/include/small_unordered_flat_multiset.hpp
-- Up-to-date: /tmp/install2/include/small_flat_multimap.hpp
-- Up-to-date: /tmp/install2/include/small_unordered_flat_map.hpp
-- Up-to-date: /tmp/install2/include/small_vector.hpp
-- Up-to-date: /tmp/install2/include/compact_vector.hpp
-- Up-to-date: /tmp/install2/include/small_flat_set.hpp
-- Up-to-date: /tmp/install2/include/segmented_vector.hpp
-- Up-to-date: /tmp/install2/include/small_unordered_flat_multimap.hpp
-- Up-to-date: /tmp/install2/include/small_flat_multiset.hpp
-- Up-to-date: /tmp/install2/include/small_unordered_flat_set.hpp

No sfl subfolder listed.

I still prefer the current behavior with sfl folder, because it keeps a namespace to avoid header name collision.

Regards.

move constructor failed

    cout << "Test constructor(small_vector&&) (N == 0)." << endl;
    {
        sfl::small_vector<xint, 0, TPARAM_ALLOCATOR<xint>> v1({10, 20, 30, 40, 50});

        sfl::small_vector<xint, 0, TPARAM_ALLOCATOR<xint>> v2(std::move(v1));

        // v1 is in a valid but unspecified state

        CHECK(v1.size() == 0); //*************** new add. failed this **********************
        CHECK(v2.size() == 5);
        CHECK(v2.capacity() == 5);
        CHECK(*v2.nth(0) == 10);
        CHECK(*v2.nth(1) == 20);
        CHECK(*v2.nth(2) == 30);
        CHECK(*v2.nth(3) == 40);
        CHECK(*v2.nth(4) == 50);

        sfl::small_vector<xint, 0, TPARAM_ALLOCATOR<xint>> v3(std::move(v2), TPARAM_ALLOCATOR<xint>());

        // v2 is in a valid but unspecified state

        CHECK(v3.size() == 5);
        CHECK(v3.capacity() == 5);
        CHECK(*v3.nth(0) == 10);
        CHECK(*v3.nth(1) == 20);
        CHECK(*v3.nth(2) == 30);
        CHECK(*v3.nth(3) == 40);
        CHECK(*v3.nth(4) == 50);
    }

segmented_vector and push_front specialization.

Are there any plans to add this specialized function to match the deque interface? One of the reasons to why deque is pretty good is that push_front is reasonably fast. I'm not exactly sure how its implemented for deque but if I had to guess they just allocate a new block when the one at the beginning is full and only move the last element into the new block rather than shifting all elements across all the blocks.

[small_vector] Deallocations while using reserve/resize

Hello,

Nice idea, I am surprised there is still no hybrid stack/heap standardized containers like small_vector, fmt::basic_memory_buffer...

I was wondering if reserve/resize should deallocate heap when shrinking. I would expect that only shrink_to_fit would do so.
When being used in a loop, for example, it could cost some useless allocations ?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.