Deleted Added
sdiff udiff text old ( 12453:424595e0a14e ) new ( 12454:277c1f58ab6d )
full compact
1/*
2 * Copyright (c) 2007-2008 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 277 unchanged lines hidden (view full) ---

286//bitfield definitions which will end up inside it's union. As explained
287//above, these is overlayed the __storage member in its entirety by each of the
288//bitfields which are defined in the union, creating shared storage with no
289//overhead.
290#define __BitUnion(type, name) \
291 class BitfieldUnderlyingClasses##name : \
292 public BitfieldBackend::BitfieldTypes<type> \
293 { \
294 public: \
295 typedef type __StorageType; \
296 union { \
297 type __storage;
298
299//This closes off the class and union started by the above macro. It is
300//followed by a typedef which makes "name" refer to a BitfieldOperator
301//class inheriting from the class and union just defined, which completes
302//building up the type for the user.
303#define EndBitUnion(name) \

--- 79 unchanged lines hidden (view full) ---

383 {
384 typedef typename BitUnionType<T>::__StorageType Type;
385 };
386}
387
388template <typename T>
389using BitUnionBaseType = typename BitfieldBackend::BitUnionBaseType<T>::Type;
390
391namespace std
392{
393 template <typename T>
394 struct hash;
395
396 template <typename T>
397 struct hash<BitUnionType<T> > : public hash<BitUnionBaseType<T> >
398 {
399 size_t
400 operator() (const BitUnionType<T> &val) const
401 {
402 return hash<BitUnionBaseType<T> >::operator()(val);
403 }
404 };
405}
406
407#endif // __BASE_BITUNION_HH__