일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- AES
- stringprintf
- design pattern
- type_traits
- haskell
- go
- program
- ChromeTab
- Observer
- SHA1
- Functional
- template
- coroutines
- Clojure
- sprintf
- async
- Chrono
- ranges
- Android
- Scala
- traits
- kotlin
- Reflect
- CustomTab
- WebView
- RAII
- SHA512
- sha256
- web
- c++
- Today
- Total
목록type_traits (5)
프로그래밍 검색 블로그
아직 ranges가 사용중인 컴파일러에서 컴파일이 불가능해서 만들었다 ranges가 컴파일이 가능한 최신 컴파일러라면 ranges를 사용할 것여기 -> https://github.com/ericniebler/range-v3 1234 template using collection_value_type = typename std::remove_const::type::value_type;cs 함수의 인자로 들어온 collection에서 value_type만 추출 12345678 template inline auto filter(_Collection&& collection, _Func&& predicate) -> std::vector { std::vector destination; filterTo(std::for..
go언어의 defer와 거의 비슷하게 제작하였다. C++에서는 finally를 사용할수 있지만 꼭 finally에 넣을수 없는 상황도 있기 때문에아무 함수나 넣을수 있게 하는 defer를 제작12345678910111213141516171819202122232425262728293031323334#include #include templatestruct Defer{ using value_type = _Func; using const_reference = typename std::add_lvalue_reference::type; value_type defer_function; Defer(const_reference f) : defer_function(f){} Defer(value_type&& f) : de..
12345678910111213141516171819202122232425262728293031323334 //bool is_prime(unsigned long long v){// for(unsigned long long i = 2; i
여기서는 %로 받는 형식문자열을 추론해서 알아본다.12345678910template struct is_c_style_string : public false_type{};template struct is_c_style_string : public true_type{};template struct is_c_style_string : public true_type{};template struct is_c_style_string : public true_type{};template struct is_c_style_string : public true_type{};cs 이런 구조체를 추가하여 c_style의 문자열인지 알아낼 수 있도록 한다. 12345678910111213141516171819202122232..