Migrated from the original repository
Original issue: serge-sans-paille/frozen#168
Originally reported by: @pfee
I'm unable to use class template argument deduction (CTAD) with frozen::map and frozen::unordered_map. I'm able to use it with std::map and std::unordered_map.
Is this a bug with the frozen library or an issue with my code?
#include <frozen/set.h>
#include <frozen/map.h>
#include <cstdint> // pmh.h missing include fixed after 1.1.1 was released.
#include <frozen/unordered_map.h>
#include <string_view>
#include <set>
#include <map>
#include <unordered_map>
using namespace std::literals;
int main()
{
std::set a = {"one"sv, "two"sv};
frozen::set b = {"one"sv, "two"sv};
std::map c = {std::pair{"one"sv, 1}, std::pair{"two"sv, 2}};
// frozen::map d = {std::pair{"one"sv, 1}, std::pair{"two"sv, 2}}; // Compilation error
std::unordered_map e = {std::pair{"one"sv, 1}, std::pair{"two"sv, 2}};
// frozen::unordered_map f = {std::pair{"one"sv, 1}, std::pair{"two"sv, 2}}; // Compilation error
return 0;
}
I've tried compiling with v1.1.1 and with the latest (7e79c375b0) from git. Both fail in the same way.
Environment:
- openSUSE Tumbleweed
- GCC 13.2.1
- C++17
My primary reason for wanting to use CTAD is to avoid having to specify the size of the container, which can be awkward with large datasets.
I'm unable to use class template argument deduction (CTAD) with
frozen::mapandfrozen::unordered_map. I'm able to use it withstd::mapandstd::unordered_map.Is this a bug with the
frozenlibrary or an issue with my code?I've tried compiling with v1.1.1 and with the latest (7e79c375b0) from git. Both fail in the same way.
Environment:
My primary reason for wanting to use CTAD is to avoid having to specify the size of the container, which can be awkward with large datasets.