code: function bindConstructorLayout(Class, layout) {
    if ('function' !== typeof Class) {
      throw new TypeError('Class must be constructor');
    }
    if (Class.hasOwnProperty('layout_')) {
      throw new Error('Class is already bound to a layout');
    }
    if (!(layout && (layout instanceof Layout))) {
      throw new TypeError('layout must be a Layout');
    }
    if (layout.hasOwnProperty('boundConstructor_')) {
      throw new Error('layout is already bound to a constructor');
    }
    Class.layout_ = layout;
    layout.boundConstructor_ = Class;
    layout.makeDestinationObject = (() => new Class());
    Object.defineProperty(Class.prototype, 'encode', {
      value: function(b, offset) {
        return layout.encode(this, b, offset);
      },
      writable: true,
    });
    Object.defineProperty(Class, 'decode', {
      value: function(b, offset) {
        return layout.decode(b, offset);
      },
      writable: true,
    });
  }
docs: Augment a class so that instances can be encoded/decoded using a
  given layout.
  
  Calling this function couples `Class` with `layout` in several ways:
  
  * `Class.layout_` becomes a static member property equal to `layout`;
  * `layout.boundConstructor_` becomes a static member property equal
  to `Class`;
  * The {@link Layout#makeDestinationObject|makeDestinationObject()}
  property of `layout` is set to a function that returns a `new
  Class()`;
  * `Class.decode(b, offset)` becomes a static member function that
  delegates to {@link Layout#decode|layout.decode}.  The
  synthesized function may be captured and extended.
  * `Class.prototype.encode(b, offset)` provides an instance member
  function that delegates to {@link Layout#encode|layout.encode}
  with `src` set to `this`.  The synthesized function may be
  captured and extended, but when the extension is invoked `this`
  must be explicitly bound to the instance.
  
  @param {class} Class - a JavaScript class with a nullary
  constructor.
  
  @param {Layout} layout - the {@link Layout} instance used to encode
  instances of `Class`.