Sha256: a728bb538bbcdbf234199d7adf12ef970b9b931652170c86618e42ee72db3486

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

// File: lzham_helpers.h
// See Copyright Notice and license at the end of include/lzham.h
#pragma once

#define LZHAM_NO_COPY_OR_ASSIGNMENT_OP(c) c(const c&); c& operator= (const c&);

namespace lzham
{
   namespace helpers
   {
      template<typename T> struct rel_ops
      {
         friend inline bool operator!=(const T& x, const T& y) { return (!(x == y)); }
         friend inline bool operator> (const T& x, const T& y) { return (y < x); }
         friend inline bool operator<=(const T& x, const T& y) { return (!(y < x)); }
         friend inline bool operator>=(const T& x, const T& y) { return (!(x < y)); }
      };

      template <typename T>
      inline T* construct(T* p)
      {
         return new (static_cast<void*>(p)) T;
      }

      template <typename T, typename U>
      inline T* construct(T* p, const U& init)
      {
         return new (static_cast<void*>(p)) T(init);
      }

      template <typename T> 
      inline void construct_array(T* p, uint n);
      
      template <typename T, typename U>
      inline void construct_array(T* p, uint n, const U& init)
      {
         T* q = p + n;
         for ( ; p != q; ++p)
            new (static_cast<void*>(p)) T(init);
      }

      template <typename T>
      inline void destruct(T* p)
      {
         LZHAM_NOTE_UNUSED(p);
         p->~T();
      }

      template <typename T> 
      inline void destruct_array(T* p, uint n);

   }  // namespace helpers

}  // namespace lzham

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
extlzham-0.0.1.PROTOTYPE3-x86-mingw32 contrib/lzham/lzhamdecomp/lzham_helpers.h
extlzham-0.0.1.PROTOTYPE3 contrib/lzham/lzhamdecomp/lzham_helpers.h
extlzham-0.0.1.PROTOTYPE2 contrib/lzham/lzhamdecomp/lzham_helpers.h
extlzham-0.0.1.PROTOTYPE contrib/lzham/lzhamdecomp/lzham_helpers.h
extlzham-0.0.1.PROTOTYPE-x86-mingw32 contrib/lzham/lzhamdecomp/lzham_helpers.h