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

Add support for std::byte as Dataset type #480

@ghost

Description

Creating a dataset with underlying type of std::byte currently triggers a static assertion ("Type not supported"). This makes sense as std::byte is implemented as an enum rather than a scalar/numeric type. However, CPP Core Guidelines encourages the use of std::byte as the preferred way to refer to generic, non-character data. Does it make sense for HighFive to support this?

Minimal example of the issue:

#include <highfive/H5File.hpp>
#include <cstddef>
#include <vector>

using namespace HighFive;

int main()
{
    std::vector<std::byte> buffer(1024, std::byte(0xCD));
    File file("database.h5", File::ReadWrite | File::Create | File::Truncate);
    file.createDataSet<std::byte>("frame", DataSpace::From(buffer)).write(buffer);
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions