Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cValT Struct Reference

#include <cValT.h>

Inheritance diagram for Gray::cValT:
Gray::cMemT

Static Public Member Functions

template<class TYPE >
static void Swap (TYPE &a, TYPE &b) noexcept
 
template<class TYPE >
static COMPARE_t Compare (const TYPE &a, const TYPE &b) noexcept
 
template<>
COMPARE_t Compare (const cTimeFile &t1, const cTimeFile &t2)
 

Detailed Description

Helper functions for an arbitrary value/object type in memory. We may compare these. Similar to System.IComparable in .NET

Member Function Documentation

◆ Compare() [1/2]

template<>
COMPARE_t Gray::cValT::Compare ( const cTimeFile t1,
const cTimeFile t2 
)
inlinestatic

Overload/implementation of cValT::Compare Use cFileStatus::isSameChangeTime for FAT32 ~2 second like _WIN32 CompareFileTime() ?

◆ Compare() [2/2]

template<class TYPE >
static COMPARE_t Gray::cValT::Compare ( const TYPE a,
const TYPE b 
)
inlinestaticnoexcept

compare 2 TYPE values. Similar to .NET IComparable but for any types. Overload this template for any specific TYPE Compare. obviously TYPE must also support >. We assume all types already support ==.

Note
we need this because INT_MAX-INT_MIN is not positive !!! (and 0-0xFFFFFFFF is not negative)
also memcmp() is a backwards numeric compare for USE_LITTLE_ENDIAN (Intel) machines.

◆ Swap()

template<class TYPE >
static void Gray::cValT::Swap ( TYPE a,
TYPE b 
)
inlinestaticnoexcept

swap 2 values. similar to cMem::Swap() but uses the intrinsic = operator. dangerous for complex struct that has pointers and such. may not do a 'deep' copy. assume TYPE has a safe overloaded = operator. Overload this template for any specific TYPE Swaps.


The documentation for this struct was generated from the following files: