added new type pybind11::bytes, cleanup of various macros (fixes #49)
diff --git a/example/example2.cpp b/example/example2.cpp
index 647427b..c4e0d7c 100644
--- a/example/example2.cpp
+++ b/example/example2.cpp
@@ -72,24 +72,12 @@
std::cout << "key: " << item.first << ", value=" << item.second << std::endl;
}
- /* STL data types are automatically casted from Python */
- void print_dict_2(const std::map<std::string, std::string> &dict) {
- for (auto item : dict)
- std::cout << "key: " << item.first << ", value=" << item.second << std::endl;
- }
-
- /* Easily iterate over a setionary using a C++11 range-based for loop */
+ /* Easily iterate over a set using a C++11 range-based for loop */
void print_set(py::set set) {
for (auto item : set)
std::cout << "key: " << item << std::endl;
}
- /* STL data types are automatically casted from Python */
- void print_set_2(const std::set<std::string> &set) {
- for (auto item : set)
- std::cout << "key: " << item << std::endl;
- }
-
/* Easily iterate over a list using a C++11 range-based for loop */
void print_list(py::list list) {
int index = 0;
@@ -97,7 +85,19 @@
std::cout << "list item " << index++ << ": " << item << std::endl;
}
- /* STL data types are automatically casted from Python */
+ /* STL data types (such as maps) are automatically casted from Python */
+ void print_dict_2(const std::map<std::string, std::string> &dict) {
+ for (auto item : dict)
+ std::cout << "key: " << item.first << ", value=" << item.second << std::endl;
+ }
+
+ /* STL data types (such as sets) are automatically casted from Python */
+ void print_set_2(const std::set<std::string> &set) {
+ for (auto item : set)
+ std::cout << "key: " << item << std::endl;
+ }
+
+ /* STL data types (such as vectors) are automatically casted from Python */
void print_list_2(std::vector<std::string> &list) {
int index = 0;
for (auto item : list)