I have a function in C++ that is passed a uint64_t as nanoseconds from epoch. I have wrapped this number in an object DateTime as in
struct DateTime {
uint64_t epochns;
};
void print( DateTime ts );
Obviously the function is not exactly print as I could use Python's own for this purpose.
It is important that I use it seamlessly with Python datetime objects as in
print( datetime(1985,7,1) )
I'm unsure how to write a typemap that achieves this requirement.
Any hints?