2005/5/9

     
 

struct StringHash

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::StringHash< C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20 > Struct Template Reference
[ACDK String macros/function/classes]

#include <String.h>

List of all members.


Detailed Description

template<const char C0, const char C1 = '\0', const char C2 = '\0', const char C3 = '\0', const char C4 = '\0', const char C5 = '\0', const char C6 = '\0', const char C7 = '\0', const char C8 = '\0', const char C9 = '\0', const char C10 = '\0', const char C11 = '\0', const char C12 = '\0', const char C13 = '\0', const char C14 = '\0', const char C15 = '\0', const char C16 = '\0', const char C17 = '\0', const char C18 = '\0', const char C19 = '\0', const char C20 = '\0'>
struct acdk::lang::StringHash< C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20 >

This template compiles a ascii string literal hash code at up to 20 characters at compile time.

this enables using it in case branches.

This code was found in the boost mailing list, posted by Jens Nilsson

    RString text = testing;

  switch (text->hashCode())
  {
  case StringHash<'t','e','s','t', 'i', 'n', 'g' >::hash:
    sys::coreout << OK;
    break;
  default:
    break;
  }


Public Types

enum  { hash }


Member Enumeration Documentation

template<const char C0, const char C1 = '\0', const char C2 = '\0', const char C3 = '\0', const char C4 = '\0', const char C5 = '\0', const char C6 = '\0', const char C7 = '\0', const char C8 = '\0', const char C9 = '\0', const char C10 = '\0', const char C11 = '\0', const char C12 = '\0', const char C13 = '\0', const char C14 = '\0', const char C15 = '\0', const char C16 = '\0', const char C17 = '\0', const char C18 = '\0', const char C19 = '\0', const char C20 = '\0'>
anonymous enum
 

Enumeration values:
hash