Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
BinaryGap, C++ - Find longest sequence of zeros in binary representation of an integer.
Unqualified free functions
Fun with Pointers #2
overloading
Ordered Graphs
Te
First
STL Stack, C ++
Forgetting to check end
Find in vector vs unordered_map
Please log in to post a comment.