| 1 | /*
|
|---|
| 2 | */
|
|---|
| 3 |
|
|---|
| 4 | /*
|
|---|
| 5 | * Copyright (c) 2008 Broadcom Corporation
|
|---|
| 6 | *
|
|---|
| 7 | * All rights reserved.
|
|---|
| 8 | *
|
|---|
| 9 | * This source code contains proprietary, confidential and trade secret
|
|---|
| 10 | * information of Broadcom Corp, and except as provided by written agreement
|
|---|
| 11 | * with Broadcom Corp no part may be disclosed, distributed, reproduced,
|
|---|
| 12 | * transmitted, transcribed, stored in a retrieval system, adapted or
|
|---|
| 13 | * translated in any form or by any means electronic, mechanical, magnetic,
|
|---|
| 14 | * optical, chemical, manual or otherwise.
|
|---|
| 15 | */
|
|---|
| 16 |
|
|---|
| 17 | #include "boost/format.hpp"
|
|---|
| 18 | #include <iostream>
|
|---|
| 19 | #include <iomanip>
|
|---|
| 20 | #include <cassert>
|
|---|
| 21 |
|
|---|
| 22 | class bcu {
|
|---|
| 23 | public:
|
|---|
| 24 | enum { BCU_ANON = 0x8000 };
|
|---|
| 25 | };
|
|---|
| 26 |
|
|---|
| 27 | template<class T>
|
|---|
| 28 | void
|
|---|
| 29 | bar(const T& x) {
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | template<class T>
|
|---|
| 33 | void
|
|---|
| 34 | foo1(const T& x) {
|
|---|
| 35 | bar(x);
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | template<class T>
|
|---|
| 39 | void
|
|---|
| 40 | foo2(const T& x) {
|
|---|
| 41 | bar<T>(x);
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | int
|
|---|
| 45 | main() {
|
|---|
| 46 | enum mytype_e { ANON = 0x8000 };
|
|---|
| 47 | foo1(0);
|
|---|
| 48 | foo1(bcu::BCU_ANON);
|
|---|
| 49 | // foo2(bcu::BCU_ANON);
|
|---|
| 50 | foo1(ANON);
|
|---|
| 51 | // foo2(ANON);
|
|---|
| 52 | std::cout << boost::format("%32x\n") % bcu::BCU_ANON;
|
|---|
| 53 | std::cout << boost::format("%32x\n") % ANON;
|
|---|
| 54 | std::cout << std::hex << std::showbase << bcu::BCU_ANON << std::endl;
|
|---|
| 55 |
|
|---|
| 56 | return 0;
|
|---|
| 57 | }
|
|---|