[odb-users] Compilation issue with gcc

Pierre-Olivier Rocher trynitron at gmail.com
Thu Jun 2 10:57:37 EDT 2016


The calling function

template<typename T>inline bool data<T>::erase(const int fm_id)
{
	try
	{
		m_database->erase<T>(fm_id);

		return true;
	}
	catch (const odb::exception& e)
	{
		std::cout<<"unable to erase " + std::string(typeid(T).name()) + " ->
" + std::string(e.what())<<std::endl;

	}

	return false;
}

m_database is a std::shared_ptr<odb::database>

T is a regular odb class, with #pragma db object
pointer(std::shared_ptr) session and a

#pragma db id autounsigned long m_id;

I think all necessary code is present.

Thanks again



2016-06-02 14:10 GMT+02:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi,
>
> Pierre-Olivier Rocher <trynitron at gmail.com> writes:
>
> > error: no matching function for call to ‘odb::database::erase(const
> int&)’
> > m_database->erase<T>(fm_id);
> >
> > [...]
> >
> > It seems to be a cast issue between "const int&" and "const typename
> > odb::object_traits<T>::id_type&" but i'm currently not able to fix the
> > issue.
>
> Show us the definition of your objects, particularly the object id data
> member as well as the code where you get the error. Without this info
> we can only guess and speculate.
>
> Boris
>


More information about the odb-users mailing list