构造函数是用来禁止隐式类型转换的
// 条款3
const char * p 表示 (char * p) 整体是const,即内容不可变
| #include <iostream> | |
| using namespace std; | |
| // compile without optimization | |
| // clang++ -std=c++17 -stdlib=libc++ -O0 test_alloc.cpp | |
| // elapse 6.25 seconds with N=100*1000*1000 | |
| size_t test_alloc(size_t N) { | |
| size_t r; |
| /* | |
| PHP | |
| └── is | |
| ├── minor | |
| │ └── perpetrated | |
| │ └── whereas | |
| │ └── skilled | |
| │ └── perverted | |
| │ └── professionals. | |
| └── a |
| #!/bin/bash | |
| BRANCH=release_50 | |
| ROOT=`pwd` | |
| SRC=$ROOT/llvm | |
| # GIT_BASE_URL=https://llvm.org/git | |
| if [[ "$GIT_BASE_URL" == "" ]]; then | |
| GIT_BASE_URL=https://github.com/llvm-mirror | |
| fi | |
| BUILDER=ninja |
| - Alert "A valid provisioning profile for this executable was not found." when you debuging iOS app on a device. | |
| Delete Derived Data and rebuild. |
| #import <mach/mach.h> | |
| #import <pthread/pthread.h> | |
| void catchMachExceptions(void); | |
| void *exc_handler(void *ignored); | |
| static mach_port_name_t myExceptionPort; | |
| void catchMachExceptions(void) { |
So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?
But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?
Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.
| /** | |
| * SOCKS5 Proxy as per RFC1928 | |
| * @see : http://www.ietf.org/rfc/rfc1928.txt | |
| */ | |
| /** | |
| * Load Dependancies | |
| */ | |
| var net = require('net'), |