Questions tagged [casting]
Casting is a process where an object type is explicitly converted into another type if the conversion is allowed.
4
questions with no upvoted or accepted answers
4
votes
0answers
80 views
Implementation of narrow_cast in C++
To summarize what I've been trying to do, I basically tried to make a safe narrow_cast operator, which casts to the Target type if and only if the value is ...
4
votes
0answers
46 views
Safe pointer casting : static_cast or dynamic_cast
Context: I'm using the clone pattern for creating copies of polymorphic classes which may use virtual inheritance (I hope to get rid of the latter). So when calling ...
2
votes
0answers
50 views
Convenient way to make an UIImageView ExpressibleByStringLiteral
I want to reduce boiler-plate code and write like this when developing in iOS:
let imgView: UIImageView = "share_fareware_text_bg"
Here is implementation code:
<...
1
vote
0answers
105 views
Helper class for accessing blobs and mmap memory - follow up
This class was inspired from Microsoft's array_view.
It intended to use with mmap-ed memory for easily check bounds and so on.
I probably will need to throw exceptions, but this is not my usual way ...