Helper class for accessing blobs and mmap memory
BlobRef details


You should provide a default constructor.
safeAccessMemory contains a bug. If you have an empty BlobRef and you call safeAccessMemory(0, 0) you will deference a nullptr (the guard fails).
Don't use c-style casts. In your cases you should use reinterpret_cast. This helps readability, search-ability and signals clear intent.
as can invoke undefined behaviour if called on certain types. The gritty details are in 3.10.10 of the C++ spec.



  If a program attempts to access the stored value of an object through
  a glvalue of other than one of the following types the behavior is
  undefined:
  
  the dynamic type of the object. 
  
  a cv-qualified version of the dynamic type of the object.
  
  a type similar (as defined in 4.4) to the dynamic type of the object.
  
  a type that is the signed or unsigned type corresponding to the dynamic type of the object.
  
  a type that is the signed or unsigned type corresponding to a cv-qualified version of the dynamic type of the object.
  
  an aggregate or union type that includes one of the aforementioned types among its elements or nonstatic data members (including, recursively, an element or non-static data member of a subaggregate or contained union), a type that is a (possibly cv-qualified) base class type of the dynamic type of the object.
  
  a char or unsigned char type.


My understand is that there's no easy way to make this work (the gsl folks removed theirs)

Unfortunately this would remove the entire essence of this class. One approach you could take to remedy this would be to use type-traits to restrict the function to types for which it will be well defined.

template &lt;class T, typename = std::enable_if_t&lt;std::is_integral&lt;T&gt;::value&gt;&gt;
const T *as(size_t const pos = 0, size_t const elements = 1) const noexcept{
    return (const T *) safeAccessMemory(pos, elements * sizeof(T));
}