Skip to content

Commit

Permalink
Fix static assert for ReadDataWrapper
Browse files Browse the repository at this point in the history
oruebel committed Sep 19, 2024
1 parent cdffc74 commit 89f6d29
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/io/ReadIO.hpp
Original file line number Diff line number Diff line change
@@ -157,6 +157,29 @@ class DataBlock
}
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<StorageObjectType T>
struct is_allowed_storage_object_type : std::false_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Dataset>
: std::true_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Attribute>
: std::true_type
{
};

/**
* @brief Class for wrapping data objects (datasets or attributes) for reading
* data from a file
@@ -182,29 +205,6 @@ class ReadDataWrapper
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<StorageObjectType T>
struct is_allowed_storage_object_type : std::false_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Dataset>
: std::true_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Attribute>
: std::true_type
{
};

/**
* Static assert to enforce the restriction that ReadDataWrapper can only be
* instantiated for OTYPE of StorageObjectType::Dataset and

0 comments on commit 89f6d29

Please sign in to comment.