Mesh attributes for types with memory allocation #130
-
I saw in the wiki of mesh attributes:
So I tried to add : // ...
#include <geogram/basic/memory.h>
// ...
geo_register_attribute_type<GEO::vector<index_t>>("indices_vector");
// ... to ...
geogram/basic/string.h:334:24: error: no match for ‘operator>>’ (operand types are ‘std::istringstream’ {aka ‘std::__cxx11::basic_istringstream<char>’} and ‘GEO::vector<unsigned int>’)
334 | return (in >> value) && (in.eof() || ((in >> std::ws) && in.eof()));
| ~~~~^~~~~~~~~
...
geogram/basic/string.h:244:17: error: no match for ‘operator<<’ (operand types are ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’} and ‘const GEO::vector<unsigned int>’)
244 | out << value;
| ~~~~^~~~~~~~
... Are attributes for custom types with memory allocation still supported? Is the compilation error related to file I/O? If so, what are the specifications for serialization of custom type attributes? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, I confirm that attributes for types that are not POD (Plain Ordinary Datatype) is not supported. It used to be supported in the past, but it introduces much complexity in the system, and significant runtime cost, so we decided to remove it. One possibility is to store indices in the attribute, and store the std::strings in a vector elsewhere. I fixed the sentence in the documentation |
Beta Was this translation helpful? Give feedback.
Hello, I confirm that attributes for types that are not POD (Plain Ordinary Datatype) is not supported.
It used to be supported in the past, but it introduces much complexity in the system, and significant runtime cost, so we decided to remove it.
One possibility is to store indices in the attribute, and store the std::strings in a vector elsewhere.
I fixed the sentence in the documentation