MEM is one of the few raster formats that supports the AddBand() method (the other main one being VRT). The existing GDALRaster::addBand() can be modified to accept a vector of pixel data for a new band without copying (in the case of a MEM dataset as follow up to #910).