Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dynamically allocated array in unique_ptr with custom deleter.
//clang 3.8.0 #include <iostream> #include <memory> // This is just to make it compile. Ignore extern void *pffft_aligned_malloc(size_t nb_bytes); extern void pffft_aligned_free(void *); // int main() { // Don't actually want to call this :) if (false) { auto deleter=[&](float* ptr){ pffft_aligned_free(ptr); }; auto floatArray = std::unique_ptr<float[], decltype(deleter)>(static_cast<float*>(pffft_aligned_malloc(1234)), deleter); } std::cout << "Hello, world!\n"; }
run
|
edit
|
history
|
help
0
GreedyProblem1
Graphs Iteration2 Directed Graphs
First
range based for loop temporary object lifetime issue example
Return temporary
2574 EC
move_string
Peregruzka
ArrayList Example Starter Code 2
Random values and probability distribution