Hi! I am constructing a bigint class which contains a vector with all the digits in it. Now I want some operations for the class. if a, b and c is of this class, I want to be able to write a = b + c without having to copy the result of the + operation, the sum, into a. If a, b and c would have been ordinary ints, would the result of the operation have been calculated first and then copied into a or would it be written directly to a? I suppose it's not possible to changes the adress of a to match the adress of the result, since a has a probably has a constant adress, but can you change everything in a (exluding the actual vector data, the digits, which really not is a part of the object) so that the vector's internal pointer points to the adress as the + results vector's pointer? What is the best way to solve this? What is possible?

I would like the = operator to work quickly and hence not copying everything (including the digits) straight of.

I would also like it if there where some operation or function which did copy another bigint so that everything (including the digits) where duplicated, for example if I write a = b, then b should be duplicated into a, else, if there isn't any way to separate duplicating = from assigning = then a function duplicate or something could be created so you can write a.setto(b) or b.duplicate(a) or similar.

Every suggestion is welcome, I supose this could be solved i a thousand ways, but I have no clue how to fix this. If it seems like there's no good solution then I'm probably gonna have to work with pointers to bigints instead of bigints directly, it will probably not slow it down very much but it's lengthy.

Thanks.