Buffer.opEquals

Check whether the data of the buffer is equals to the given array.

  1. bool opEquals(T[] data)
  2. bool opEquals(T[] data)
    class Buffer
    pure nothrow @nogc
    bool
    opEquals
    (
    T
    )
    (
    in T[] data
    )
    if (
    T.sizeof != 1
    )

Examples

t {

		Buffer buffer = new Buffer([1, 2, 3]);

		assert(buffer == [1, 2, 3]);
		version(BigEndian) assert(buffer == cast(ubyte[])[0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3]);
		version(LittleEndian) assert(buffer == cast(ubyte[])[1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]);

Meta