mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Remove dependency on C++ headers? #484
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failed to compile with
-nostdinc++because#include <new>, how about replace all replacement news with memcpy?There are 4 calls to placement new, Not sure how you would do that tho. Have a static instance filled with all default values and memcpy? Sounds rather awkward and unpleasant to maintain.
Also not sure of the benefits. I'd rather avoid the additional maintenance.
hmm, how about add a member function that mirror the constructor, call that on the pointer return from malloc instead of replacement new?
I'm not sure it is possible with the syntax of the call to new. If you can find a way to do it feel free to try.
it is possible to have placement new without including new:
@nem0 could you clarify the code above? Not sure to understand how it would work.
It may also possibly help with https://github.com/ocornut/imgui/issues/504
I also wanted to get rid of new include in my engine, you can see it here https://github.com/nem0/LumixEngine/blob/master/src/engine/core/iallocator.h
The NewPlaceholder is there just because it is not possible to redefine the default placement new (at least according to standard), however it is legal to define your own.
VA_ARGS is there because of templates:
Usage should be something along these lines:
or without allocator:
Note: all the examples are just from my head, there might be some errors in them.
Thanks! I understand and will experiment with that.
@yngccc I have removed the dependency on the
<new>header now.Let us know if that works better for you. Thanks Mikulas!
@ocornut This is great, thanks!