Hello,
Can anybody help me to fix the error while making make_persistent for a char array?
#define VSIZE 20
struct PNode {
PNode(int k, string val)
: key(std::move(k))
{
value = pobj::make_persistent<char[]>(VSIZE);
strcpy(value.get(), val.c_str());
}
pobj::p< int> key;
pobj::persistent_ptr<char[]> value;
PNode(){}
};
The error I am getting is: no matching function for call to ‘make_persistent<char []>(int)’
value = pobj::make_persistent<char[]>(VSIZE);
^
/usr/include/libpmemobj++/make_persistent.hpp:75:1: note: candidate: ‘template<class T, class ... Args> typename pmem::detail::pp_if_not_array<T>::type pmem::obj::make_persistent(Args&& ...)’
make_persistent(Args &&... args)
^~~~~~~~~~~~~~~
/usr/include/libpmemobj++/make_persistent.hpp:75:1: note: template argument deduction/substitution failed:
/usr/include/libpmemobj++/make_persistent.hpp: In substitution of ‘template<class T, class ... Args> typename pmem::detail::pp_if_not_array<T>::type pmem::obj::make_persistent(Args&& ...) [with T = char []; Args = {}]’:
PM-FQLFHash.hpp:164:48: required from here
/usr/include/libpmemobj++/make_persistent.hpp:75:1: error: no type named ‘type’ in ‘struct pmem::detail::pp_if_not_array<char []>’
Thanks,
Mukti