I'm having some trouble with the borrow checker. I want to do this:
for entry in WalkDir::new(".")
.into_iter()
.filter_map(|e| e.ok())
.map(|e| e.path().parent().unwrap())
{}
| a |
| #include <iostream> | |
| #include <cassert> | |
| #include <type_traits> | |
| struct nonesuch { | |
| nonesuch() = delete; | |
| ~nonesuch() = delete; | |
| nonesuch(nonesuch const&) = delete; | |
| void operator=(nonesuch const&) = delete; | |
| }; |
| #include <experimental/tuple> | |
| #include <experimental/type_traits> | |
| #include <iostream> | |
| #include <tuple> | |
| #include <type_traits> | |
| #include <utility> | |
| #include <vrm/pp.hpp> | |
| template <typename T> | |
| struct type_w |
| #define assume(cond) do { if (!(cond)) __builtin_unreachable(); } while (0) | |
| int func(int x){ | |
| assume(x >=0 && x <= 10); | |
| if ( x > 11 ){ | |
| return 2; |
| // Expressive Pi | |
| // ------------- | |
| // | |
| // Fluent C++ Blog Post: The Pi Day Challenge for Expressive Code | |
| // http://www.fluentcpp.com/2017/03/02/the-pi-day-challenge-for-expressive-code-in-c/ | |
| // | |
| // Author: William Killian | |
| // Email: [email protected] | |
| // Github: http://www.github.com/willkill07 | |
| // Website: https://www.eecis.udel.edu/~wkillian |
| #include <type_traits> | |
| #include <utility> | |
| #include <iostream> | |
| #include <tuple> | |
| #include <cassert> | |
| using namespace std; | |
| template <typename... Ts> | |
| struct overloader : Ts... |
| #include <functional> | |
| #include <type_safe/variant.hpp> | |
| #include <type_safe/visitor.hpp> | |
| #include <utility> | |
| #define FWD(...) ::std::forward<decltype(__VA_ARGS__)>(__VA_ARGS__) | |
| template <typename... Ts> | |
| struct overload_set : Ts... | |
| { |
| ./typesafevariant3.cpp:13:43: error: no member named 'bar' in 'type_safe::nullvar_t' | |
| auto operator()(T x) const { return x.bar(); } | |
| ~ ^ | |
| /usr/local/include/type_safe/visitor.hpp:180:29: note: in instantiation of function template | |
| specialization 'visitor::operator()<type_safe::nullvar_t>' requested here | |
| -> decltype(std::forward<Visitor>(visitor)(std::forward<Args>(args)...)) | |
| ^ | |
| /usr/local/include/type_safe/visitor.hpp:194:29: note: while substituting deduced template arguments | |
| into function template 'call_impl' [with Args = <const type_safe::nullvar_t &>] | |
| -> decltype(call_impl(0, std::forward<Visitor>(visitor), |
I'm having some trouble with the borrow checker. I want to do this:
for entry in WalkDir::new(".")
.into_iter()
.filter_map(|e| e.ok())
.map(|e| e.path().parent().unwrap())
{}
| #include <iostream> | |
| #include <vector> | |
| #include <tuple> | |
| namespace foo | |
| { | |
| template <typename T> | |
| struct print final | |
| { | |
| const T& _x; |