In the current release of MySQL++, Connection has a function insert_id
to get it:
In the forthcoming release of v3, Query and SimpleResult both have
insert_id functions. Query::insert_id does the actual request to the
database server (by delegating to dbdriver), but SimpleResult is
populated with it when you call Query::execute.
Version 3 release is imminent so I'd go for that if I were you.
If you can't use any of those, use the LAST_INSERT_ID() SQL function.