Fix for bug #3599: cv::FileStorage does not work for std::vector of user-defined struct.

pull/2476/head
Koji Miyazato 11 years ago
parent 70e22b682d
commit b96762a48f
  1. 4
      modules/core/include/opencv2/core/persistence.hpp

@ -697,11 +697,11 @@ void write(FileStorage& fs, const String& name, const Range& r )
template<typename _Tp> static inline
void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec )
{
internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0));
fs << (DataType<_Tp>::fmt != 0 ? "[:" : "[");
write(fs, vec);
fs << "]";
}
static inline
void read(const FileNode& node, bool& value, bool default_value)
{

Loading…
Cancel
Save