#include "multibuf.ih"

bool MultiBuf::remove(ostream &os)
{
    iterator iter = find_if(                        // find the 1st Stream
                        d_os.begin(), d_os.end(),   // containing &os
                        [&](Stream const &stream)
                        {
                            return stream.d_ostrPtr == &os;
                        }
                     );

    if (iter == d_os.end())                         // not found
        return false;

    d_os.erase(iter);                               // OK: erase its Stream
    return true;
}
