diff --git a/libretroshare/src/retroshare/rsids.h b/libretroshare/src/retroshare/rsids.h index ff21cbb64..6063ca934 100644 --- a/libretroshare/src/retroshare/rsids.h +++ b/libretroshare/src/retroshare/rsids.h @@ -53,6 +53,18 @@ template c // explicit t_RsGenericIdType(const unsigned char bytes[]) ; + // Explicit constructor from a different type, checking that the sizes are compatible. + // This is used for conversions such as + // + // GroupId -> CircleId + // GroupId -> GxsId + // + template + explicit t_RsGenericIdType(const t_RsGenericIdType& id) + { + memcpy(bytes,id.toByteArray(),ID_SIZE_IN_BYTES) ; + } + // Random initialization. Can be useful for testing. // static t_RsGenericIdType random()