@@ -584,18 +584,11 @@ struct GetCurrentView
584584
585585 static constexpr char const *errorMsg = " DynamicMemoryView" ;
586586};
587-
588- template <>
589- pybind11::object
590- GetCurrentView::call<std::string>(PythonDynamicMemoryView const &)
591- {
592- throw std::runtime_error (" [DynamicMemoryView] Only PODs allowed." );
593- }
594587} // namespace
595588
596589pybind11::object PythonDynamicMemoryView::currentView () const
597590{
598- return switchNonVectorType <GetCurrentView>(m_datatype, *this );
591+ return switchDatasetType <GetCurrentView>(m_datatype, *this );
599592}
600593
601594namespace
@@ -628,14 +621,6 @@ struct StoreChunkSpan
628621
629622 static constexpr char const *errorMsg = " RecordComponent.store_chunk()" ;
630623};
631-
632- template <>
633- PythonDynamicMemoryView StoreChunkSpan::call<std::string>(
634- RecordComponent &, Offset const &, Extent const &)
635- {
636- throw std::runtime_error (
637- " [RecordComponent.store_chunk()] Only PODs allowed." );
638- }
639624} // namespace
640625
641626inline PythonDynamicMemoryView store_chunk_span (
@@ -656,7 +641,7 @@ inline PythonDynamicMemoryView store_chunk_span(
656641 std::begin (shape),
657642 [&maskIt](std::uint64_t ) { return !*(maskIt++); });
658643
659- return switchNonVectorType <StoreChunkSpan>(
644+ return switchDatasetType <StoreChunkSpan>(
660645 r.getDatatype (), r, offset, extent);
661646}
662647
@@ -726,7 +711,7 @@ void load_chunk(
726711 }
727712 }
728713
729- switchNonVectorType <LoadChunkIntoPythonBuffer>(
714+ switchDatasetType <LoadChunkIntoPythonBuffer>(
730715 r.getDatatype (), r, buffer, buffer_info, offset, extent);
731716}
732717
@@ -910,9 +895,6 @@ void init_RecordComponent(py::module &m)
910895 // std::endl; typestring: encoding + type + number of bytes
911896 switch (dtype)
912897 {
913- case DT::BOOL:
914- return rc.makeConstant (*static_cast <bool *>(buf.ptr ));
915- break ;
916898 case DT::CHAR:
917899 return rc.makeConstant (*static_cast <char *>(buf.ptr ));
918900 break ;
@@ -971,6 +953,11 @@ void init_RecordComponent(py::module &m)
971953 return rc.makeConstant (
972954 *static_cast <std::complex <long double > *>(buf.ptr ));
973955 break ;
956+ case DT::BOOL:
957+ throw std::runtime_error (
958+ " make_constant: "
959+ " Boolean type not supported!" );
960+ break ;
974961 default :
975962 throw std::runtime_error (
976963 " make_constant: "
@@ -998,10 +985,6 @@ void init_RecordComponent(py::module &m)
998985 " make_constant" ,
999986 &RecordComponent::makeConstant<double >,
1000987 py::arg (" value" ))
1001- .def (
1002- " make_constant" ,
1003- &RecordComponent::makeConstant<bool >,
1004- py::arg (" value" ))
1005988 .def (
1006989 " make_empty" ,
1007990 [](RecordComponent &rc, Datatype dt, uint8_t dimensionality) {
0 commit comments