Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

ambiguous calls prevents compilation (gcc, clang) #11

@illwieckz

Description

@illwieckz

Ambiguous calls prevents compilation (gcc, clang):

crn_vector.cpp:26:53: error: call of overloaded ‘next_pow2(size_t&)’ is ambiguous
          new_capacity = math::next_pow2(new_capacity);
                                                     ^
In file included from crn_core.h:173:0,
                 from crn_vector.cpp:3:
crn_math.h:84:21: note: candidate: crnlib::uint32 crnlib::math::next_pow2(crnlib::uint32)
       inline uint32 next_pow2(uint32 val)
                     ^~~~~~~~~
crn_math.h:95:21: note: candidate: crnlib::uint64 crnlib::math::next_pow2(crnlib::uint64)
       inline uint64 next_pow2(uint64 val)
crn_vector.cpp:25:60: error: call of overloaded ‘is_power_of_2(size_t&)’ is ambiguous
       if ((grow_hint) && (!math::is_power_of_2(new_capacity)))
                                                            ^
In file included from crn_core.h:173:0,
                 from crn_vector.cpp:3:
crn_math.h:59:19: note: candidate: bool crnlib::math::is_power_of_2(crnlib::uint32)
       inline bool is_power_of_2(uint32 x) { return x && ((x & (x - 1U)) == 0U); }
                   ^~~~~~~~~~~~~
crn_math.h:60:19: note: candidate: bool crnlib::math::is_power_of_2(crnlib::uint64)
       inline bool is_power_of_2(uint64 x) { return x && ((x & (x - 1U)) == 0U); }
                   ^~~~~~~~~~~~~

Is there a need to keep both uint32/uint64 versions at the same time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions