forked from codenuri/TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboost.cpp
More file actions
28 lines (24 loc) · 691 Bytes
/
Copy pathboost.cpp
File metadata and controls
28 lines (24 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* HOME : ecourse.co.kr
* EMAIL : smkang @ codenuri.co.kr
* COURSENAME : C++ Template Programming
* MODULE : boost.cpp
* Copyright (C) 2017 CODENURI Inc. All rights reserved.
*/
#include <iostream>
#include <typeinfo>
#include <boost/type_index.hpp>
using namespace std;
using namespace boost::typeindex;
template<typename T> void foo(const T a)
{
// cout << "T : " << typeid(T).name() << endl;
// cout << "T : " << typeid(a).name() << endl;
cout << "T : " << type_id_with_cvr<T>().pretty_name() << endl;
cout << "a : " << type_id_with_cvr<decltype(a)>().pretty_name() << endl;
}
int main()
{
foo(3); // T : int a : const int
foo(3.3);
}