« first day (2282 days earlier)      last day (2666 days later) » 
00:00 - 12:0012:00 - 00:00

12:01 AM
@Borgleader
 
floofy <3
sup @jaggedSpire
 
Hey, @Tony, how you been? <3
 
I been good
working mostly
 
nods
 
12:04 AM
I used one of those open source library for one of the apps because of convenience, then years later, app stopped working, not only do I have to work on the app I also have to hack the library
 
I'm doing all right. :)
There's an ice storm warning in effect, that'll continue for the next few days, so I'm holing up in my apartment, and I got today sort of off.
by sort of off, I mean I was allowed to work the time I would have today at another time
I chose yesterday, following my usual 9 hours of work, because there is something deeply and terribly wrong with my priorities.
so I got a 13-hour work day and a 3-day weekend
it all evens out in the end, I guess. I went home, stayed up another few hours, and then slept for 11 of them
 
user1804599
12:36 AM
fun (A : Set) (a b c : list A) =>
list_ind A
  (fun a0 : list A => concat A (concat A a0 b) c = concat A a0 (concat A b c))
  eq_refl
  (fun (a0 : A) (a1 : list A)
     (IHa : concat A (concat A a1 b) c = concat A a1 (concat A b c)) =>
   eq_ind_r
     (fun l : list A => cons A a0 l = cons A a0 (concat A a1 (concat A b c)))
     eq_refl IHa) a
     : forall (A : Set) (a b c : list A),
       concat A (concat A a b) c = concat A a (concat A b c)
 
user1804599
We can conclude that list concatenation is associative.
 
user1804599
CoqIde is really nice.
 
@jaggedSpire std::boop(this_snoot);
@Mysticial lol, he's not wrong
 
Ven
@rightfold having fun with coq?
 
user1804599
:3
 
12:41 AM
ayyy
 
hehe
 
Hi folks :D
 
yo
I saw you hanging around yesterday.
enjoying your time here so far?
 
Seems less crazy than it was yesterday, but yes. ouo
 
12:51 AM
yeah, last night was really something. I'm sad I missed it
 
Yeah, its typically slower Friday night because most people are drinking at home instead of hanging out in an online chat room.
 
That's good. I like nice n slow =u=
 
@Mikhail lol
 
I'm thinking of winding down myself
Though not necessarily with alcohol x~x
 
then again I might have been off getting dessert at a bar if the weather hadn't decided that snow was boring, and covering everything in a quarter-inch of ice was a far superior move.
 
12:54 AM
@Mikhail but ... not everyone is a closet alcoholic :p
 
I'm not!
 
Oh geez
That sounds really dangerous D:
 
I have too many vices already
@Nemo yeah, the city has been pretty much shut down
 
For the better. Urf.
We recently had a pretty bad snowstorm
Though "snowstorm" in oregon is like...an inch
 
hehe
 
12:55 AM
Didn't stop people from panicking and driving like idiots tho
 
still, the ability to deal with snow of any kind is directly proportional to the frequency you receive it.
 
Aye. It's only snowed like...5 times in my life, and I'm 27
Three of those times were in the past two years.
 
I think there might have been some panicking in Georgia a few years ago when they got a half-inch.
A few car fires, you know.
 
>~>
Typical chaos and panic
 
12:56 AM
just snow things
and then you have Toronto
with its fleet driving in formation
 
It snows a couple of times a year in my hometown. But where I am now, it doesn't snow at all.
 
Now that right there is an art form. So smooth, nnf
 
also 30 degrees last night, record high in years
 
Unrelated, but on the topic of C++, I discovered policy based design last night. I then promptly discovered that using them as arguments in function is a mess. On the upside, I know more about templates now. ouo
oh this should be good
...Yeah that's exactly what it's like here. xD
 
1:02 AM
Many C++ design patterns are not applicable or good ideas for small teams and projects.
 
Better to know it n not need it than the other way around, right? :p
 
no
 
heh
 
I've seen many junior developers bomb interviews because they start quoting some bullshit programming methodology instead of telling us about the code they wrote.
For example, we asked somebody about singletons...
 
I wouldn't really consider myself junior, but I do know what you mean
 
I wonder if good code are easily forgotten relative to bad ones, because the good code you write never gives you any problem, but bad ones ... you are tormented for hours if not days trying to find out what's wrong with them
 
Singletons is a lovely example.
...are?
Are.
 
R
 
factory pattern
 
1:06 AM
Arrrr
Man could you imagine what it'd be like if SoCal froze over?
 
not really
 
I think factory pattern might be one of the most used patterns, although people don't realise that
 
Jawa
 
I can imagine San Diego's perpetual fog turning into icy fog though
 
doesn't apply to simple programs of course
 
1:08 AM
with those hills...
 
The real question I ask people is why is your code not simple
 
I remember when I was in uni many years ago, there was a hail storm with hail the size of tennis balls
 
o~o;
 
B====D
 
@Mikhail if it was hard to write it should be hard to read
 
1:10 AM
^ this
 
Snrk
 
code might not be simple because the amount of functionalities it has? simple answer
 
idk, how many people work on the STL? I've found that a lot of more intelligible than some of the stuff from <removed due to NDA>.
 
Depends, specification or implementation? :p
hee
 
Honestly, one of the advantages of C++ compared to my work on Python, is that relativity large code bases can be maintained by single people. On the other hand a C++ developer is much harder to find, and costs like 2x more...
In retrospect it would be interesting to me if somebody could provided insight into the financial realities of choosing C++ over Python.
 
1:14 AM
I'm currently unemployed, if that counts. :p
 
Do you have a linked-in and a slave mentality?
 
Yes and probably. :p
 
lol
 
1:31 AM
May I ask where you're from, Spire?
 
 error LNK2026: module unsafe for SAFESEH image.
FML
 
Whoa
How'd you even do that >u<
 
Buy something for $25k, get SDK from 2003
 
Ahh, yeah. That'd do it.
 
Also its x86, so its going to be quarantined in its own little IPC box.
 
1:36 AM
Some engine or somethin?
 
laser
 
Mmm. The oldest code I ever worked with was from mid 1999 x~x
 
ever included Windows.h?
 
Yes, but I never edited it. :p
 
Also C++ exceptions aren't free on x86
Their real mistake was using C++
 
1:41 AM
I have worked with cobol programmers before (as a C++ dev)
backend was written in cobol
 
I was not aware that MySQL was written in cobol
 
MySQL (officially pronounced as /maɪ ˌɛskjuːˈɛl/ "My S-Q-L",) is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius' daughter, and "SQL", the abbreviation for Structured Query Language. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation. For proprietary use, several paid editions...
written in C/C++
 
So spicy, Mikhail :p
 
I read cobol as alcohol
 
1:54 AM
Alcobol x)
2
 
I kinda like her dress actually
Would be good for a dress up party. <u<
 
your HTML tag is broken
 
Hah.
That joke took me a sec, I'm like...20% awake atm, tops
 
2:26 AM
@jaggedSpire Have received it. Here in San Diego, I don't receive it at all. But having grown up in South Dakota, then lived in Colorado for a few decades, I'm pretty sure I can still drive in snow reasonably well.
 
ah, yeah. I was thinking more in terms of the city government, but really it applies there too
 
I think I had to write some PL/1 back when I was a student.
Or was it PL/SQL?
Don't remember.
:D
@Mikhail that's what she said
 
Snrk
 
2:42 AM
Estimating CUDA kernel occupancy is apparently a difficult problem, but OGL's API doesn't even expose this. How come OGL can figure it out, but CUDA can't?
 
2:56 AM
Mmm, heating pad =u=
 
3:07 AM
Hey guys!
Lizard :D
I got her on the heating pad with me =u=
 
@Nemo You're supposed to be the heating pad, idgit :P
 
I produce very little heat on my own ;w;
Though sometimes I have her under my shirt, on like really cold days
 
we have lizards here too, including a native one.
 
Cuz I feel like her heating pad probably can't keep up
 
3:14 AM
chickens are one of the cheapest heaters available that lives on bio fuel (food scraps)
 
Oh, I got a really good one of chickens, sec...
Really cute gif =u=
 
yesterday, I tried to use my hen as pillow, she wouldn't let me :p
 
No oneboxed animated gifs
 
Oneboxed?
 
inline
like what you just posted
 
3:16 AM
Ahh, right.
Sorry bout that.
 
You can link to it, just dont onebox it
@jaggedSpire :3 /cc @Morwenn @Ven
 
sooo fluffy <3
 
is this reddit, facebook, or stackoverflow?
 
Them feels..
 
3:55 AM
@Borgleader all dem kitties
 
@Borgleader it's like a couple
 
 
2 hours later…
5:30 AM
 
^_^
 
5:49 AM
For the 1st time, I hacked some external open source library and now my code is working fine.
 
@Telkitty me too, but when I made a pull request, it got rejected.
 
I didn't try to modify the open source library on github, I have only just modified the copy of library in my own code.
 
@Telkitty yeah I know :)
 
 
2 hours later…
8:05 AM
I downloaded some dude's code, and it doesn't work, but I can't force myself to read the research paper.
 
8:32 AM
If you have to use libraries, use well known ones. Otherwise when you are stuck, you might not have as much resources around to help you
 
@fredoverflow Some projects were never meant to be finished. :)
 
you won't be remembered for being the busiest person alive, you will only be remembered for things you have created that are truly useful (or destructive)
 
> The response to my Dark Path blog has been entertaining. It has ranged from effusive agreement to categorical disagreement. It also elicited a few abusive insults. I appreciate the passion. A nice vocal debate is always the best way to learn. As for the insulters: you guys need to move out of your Mom’s basement and get a life.
 
8:52 AM
Parents basement must be one of the most unproductive places, on the contrary, parents garage must be the place to use computer in when you want to create a company. Because according to mythology urban legend, Amazon, Apple, Disney, Google, Harley Davidson, HP, Mattel, Microsoft, Dell and Nike among many other giants all started there
increase your chance of success now! move your operation from the basement to the garage!
 
Maybe their houses did not have a basement?
Which is more common, a basement or a garage?
 
9:07 AM
garage
not sure about the US though
in Australia, a lot of the houses have garages, very few have basement
 
why is youtube recommending I watch chess videos
 
9:28 AM
Can someone explain how you practice programming? Practice as in practice to get better. Do you sit down and try to solve a problem? Do you work on a personal project? Do you answer questions on forums?
 
Working on a project
That being said, entry level software interviews are often done as some kind of bullshit aptitude test/quiz. You're going to need to study for that.
 
@Mikhail why does that remind me of the term 'cold and calculating?' - those aptitude tests
 
pragmatic?
 
> Consider the const keyword in C++. When I was first learning C++ I didn’t use it. It was just too much on top of everything else there was to learn. But as I gained in knowledge and comfort with the language the day came when I used my first const. And down the rathole I went, fixing one compile error after another, changing hundreds and hundreds of lines of code, until the system I was working on was const-correct.
> Did I stop using const because of this experience? No, of course not. I just made sure that I knew, up front, which fields and functions were going to be const. This required a lot of up-front design; but that was worth the alternative. Did that make the problem go away? Of course not. I frequently found myself running around inside the system smearing const all over the place.
hm, interesting point
 
I'm looking for something analogous to the way musicians practice. A project is nice, but is something you need to do over a period of weeks, months or perhaps years.
 
9:35 AM
@Brandin programming is not analogous to learning a musical instrument.
 
Or it is in the sense that if you're being paid to do it, you might be better
 
I play an instrument (well used to). And I can program. They don't compare.
 
Music has music theory and instruments, and musicians practice. Programming has theory and programming language, and practicing programmers will improve. That's the analogy I mean.
 
@Mysticial Oh yeah? What about C, C#, D and F#?
@Brandin You could practice type theory by evaluating expressions on paper or something ;)
 
@Brandin That's not the way it works. If you want anything remotely comparable. Then compare programming to building a piano given a pile of wood, some steel, and all the equipment you need to put it together.
 
9:41 AM
@Brandin Do you know about Project Euler?
 
the thing that unites programming, chess playing and musical performance is being able to think of many factors beyond the immediate, and taking them into consideration to affect your current decisions, if that makes sense.
 
@edition So the ultimate project would be musical chess programming
 
@edition I would argue that a big part of music is to repeat it so many times so that it becomes muscle memory. There's not too much of that in programming except for typing out basic syntax.
Which is useful for timed programming competitions. Not that realistic in real life.
 
Definitely useful for live-programming in front of an audience!
 
The exception being vim users. I don't know how they do that. It's black magic.
 
9:48 AM
Project Euler as a resource is interesting, but some of the problems are too mathematical. If you solve the problem, can you see others' solutions by registering?
 
You can probably find all the solutions via Google.
But that would take all the fun out of it, wouldn't it?
 
The problem with that approach is, it then becomes an exercise not so much in programming, but in searching the Internet, in separating the useful from the useless. A useful skill, indeed, but a different one.
 
There is a minimum level of math competency required to do programming. It's not a very high bar though. While I don't do Project Euler or any other programming competitions, the examples that I've seen rarely cross that bar.
@Brandin You've just described how real programming is in real life. (for the most part)
Unless you're in research or something.
 
Q: How do programmers get any work done when the Internet is down?
A: They put "How do programmers get any work done when the Internet is down?" into Google
 
Better still, if that question came from a web developer
 
9:57 AM
Sometimes its useful, but Internet search can be easily overrated. "Use the right tool for the job" comes to mind here. For example, suppose you want to use the function 'sprintf' but you've forgotten the codes for the format specifications. You could do a search like 'sprintf print hexadecimal number with leading zeros left aligned with 10 digits' or similar. Or you could learn to use the reference manual (which also has a search function).
 
man printf
@Brandin Wait, you can left-align? I never knew that.
 
Our Dabrowski has arrived.
 
And some things are just hard to remember and hard to search, at least for me. For example, when writing a Makefile, I find it difficult to remember the variable names, such as $@, $^, $* etc. Which one should I use? For this I need a personal note-taking system (usually text files or personal Wiki type of thing).
 
for (unsigned x = 1; x; x += x)
{
    printf("|%-8x|\n", x);
}
cool
 
@Brandin why not use CMake?
 
10:02 AM
Oh fuck makefiles. Hardly anybody can write one without copy-pasting a template from the internet.
And those that make it that far will spend an hour trying to debug that fucking stray space instead of a tab.
 
cmake is marginally better
 
At first, I did the same (copy and paste), but then I wanted to understand what they were doing. The trick is to start with the simplest possible Makefile for your purpose. Treat it like a script to help you get some work done. It is one, after all.
 
hi guys!
 
@edition I also use CMake. The rule I use is: once a Makefile no longer fits on a page, it is time to refactor it to CMake.
 
I found a piece of C++ code that I do not understand. I don't know what to search for on the internet also
 
10:06 AM
@Brandin cool.
 
I gound it in the Chromium Code
new (address) QualifiedName(nullAtom, AtomicString(name), nameNamespace, true);
 
@Victor I see a C-style cast.
 
It is called placement new.
 
but address is void*
 
That's exactly what placement-new expects.
 
10:08 AM
@Brandin I tried it and I get error: expected unqualified-id before 'new'
 
It constructs an object in raw memory.
 
@fredoverflow well, I am reading the standard. it's pretty interesting
 
ADVICE: Don’t use this “placement new” syntax unless you have to. Use it only when you really care that an object is placed at a particular location in memory. For example, when your hardware has a memory-mapped I/O timer device, and you want to place a Clock object at that memory location.
 
"expected unqualified-id before 'new'" - Maybe there is a problem on the preceding line?
 
@Brandin the previous line is
void *address = reinterpret_cast<Person*>(&storage) + 1;
 
10:13 AM
You can't store a Person* in a void* in C++.
@Mikhail Or when you're writing a container like std::vector or std::list.
 
um, just reinterpret cast, and you can store them...
 
sure
But I wonder why that code compiles for Victor.
#include <iostream>
#include <string>

struct Victor
{
    std::string a, b;
    Victor() : a("vic"), b("tor") {}
};

int main()
{
    char x[sizeof(Victor)];   // bla bla bla ALIGNMENT bla bla bla
    Victor * p = new (x) Victor();
    std::cout << p->a << p->b << '\n';
    p->~Victor();
}
This works, at least on my machine ;)
 
needs more auto
 
Okay, auto main() -> int it is ;)
 
what I was trying to do
is implement a storage for HTML tag names like they have here
 
10:19 AM
void* TagStorage[HTMLTagsCount * ((sizeof(HTMLQualifiedName) + sizeof(void *) - 1) / sizeof(void *))];
 
TBH, I don't understand why use void *tagStorage[...] instead of const QualifiedName storage[...]
 
Why would you want to write code like this?!
 
@fredoverflow so it actually makes no sense, right?
 
I'm sure it makes sense, but I can't be bothered to read all the documentation (if there is any).
And if you can't figure it out, just go with the simple solution.
 
Well, they need to aggressively pool memory (I assume), but do it in a C-style...
 
10:22 AM
@Mikhail what would be the C++ style?
 
> That password is not available. Either you've used it before, someone else has used it before, or it's known to have been hacked from another game or web site. Please choose a new, unique password for your ArenaNet account. We recommend creating a new password by choosing four random, unrelated words, as shown in this comic strip.
@Luc GW2's password reset page
urgh
 
@CheukKinSing correct horse battery staple?
 
yes, there's even a "generate password for me" that suggested "wife how rental capture"
 
@Mikhail sorry if I bother with stupid questions. I've never dealt so much with memory. I started this c++ project to learn, and I kind of learnt a lot
 
Hello, anyone from Italy?
 
10:27 AM
Anyway good news, transfered my authenticator to my new phone. Too bad it's so complex, I wish I could just scan the key from phone 1 to phone 2.
 
I don't see the problem with the syntax. For example this works fine:

char storage[10000];

int main()
{
void *address = reinterpret_cast<Person*>(&storage) + 1;
Person* pp = new (address) Person("some_first_name", "some_last_name");
cout << "pp:" << *pp << "\n";
}
 
@Brandin I mistook it for a cast, and so may others.
 
C cast syntax is awful.
 
@fredoverflow but it's familiar.
 
char storage[10000];
void *address = reinterpret_cast<Person*>(&storage) + 1;
totally wrong practice
 
10:33 AM
At least the placement new is applied properly
 
@Brandin if you want to use C, you better read up on how to use C struct
 
Oops, that last line should have been:
`void *address = reinterpret_cast<Person*>(storage) + 1;`
With the ampersand, it happened to work -- In the debugger I saw that it was using the area in memory that said "This program cannot be run in DOS mode." Who needs that part of the code, anyway? Let's just overwrite it!
 
reinterpret_cast a char array into a person is like making a cat from meat mince, maybe worse
 
@Telkitty How else would you do it? That is, save the Person to that area of memory?
 
so, how should I write that storage
?
would like me to write a queston on SO, so you can get some points maybe? :D
 
Xeo
10:42 AM
the address doesn't need a type, it can stay char.
No idea why you want the reinterpret_cast there
if all you wanna do is offset it from the start by the size of a Person, then do exactly that... &storage + sizeof(Person)
 
Presumably 'storage' is just a section in memory that you want to use. If 10000 bytes are enough, 'char storage[10000];' should be fine. However, this ignores alignment issues. On some implementations, it will not work. On others, it will work but will be slow if not properly aligned.
 
Xeo
also, std::aligned_storage_t etc
 
I was just reading Google Chrome's code
 
@Victor I've based questions on Firefox's code base before.
maybe you will do likewise with Chromium.
 
@Xeo If you write &storage + sizeof(Person) what should the type of storage be?
 
Xeo
10:48 AM
char is fine
 
char is only one byte. I doubt your 'Person' type fits in one byte.
 
Person was a struct I came up with to test that thing on cpp.sh
 
@Brandin no, but it will fit in many bytes.
 
Xeo
Actually, disregard that. Use std::aligned_storage_t
 
@Brandin I am not sure you are using C or C++. If C, maybe read up on C struct, if C++, learn class. I mean you could save everything into binary array & it would work if you code it correctly. But that's not normally how people save info. I would have person as struct or class, have first name and last name as fields in that class/struct. Then add read & write operators for those fields. Yes, that's more code, but clean coding.
 
10:52 AM
@Victor That web site also 'successfully' runs my incorrect program. Writing void *address = reinterpret_cast<Person*>(&storage) + 1; will cause Person to saved in the wrong location in memory. It still happens to work, but is wrong.
@Telkitty Placement new is C++ only. It cannot be used in C. When using placement-new, reinterpret_cast seems ot be reasonable. How else would you treat the section of memory as an area to save Person's? Adding accessors/mutators to Person won't change its memory layout, by the way.
 
@Brandin it was the fastest way for testing it
do we have a conclusion about this? :)
 
@Brandin but you are mixing C & C++ practices
 
Xeo
@Brandin Again: you don't need the reinterpret_cast
You treat it as a section for storing a Person by... storing a Person there. And using the pointer returned from placement new
 
@Telkitty You're mistaken. reinterpret_cast is also a C++-only feature.
 
@Victor Why can't you simply use a Person[n] or a std::array<Person, n> or a std::vector<Person>? Why all these void pointers and casts?
 
Xeo
10:59 AM
@Brandin The act of reinterpreting raw storage comes from C tho. C-style casts are basically reinterpret_casts.
 
@Xeo Can you show how to do that in code? The requirement is that there is a section in memory, say char storage[100000], and you want to store a Person there. Assume it fits.
 
@Brandin Does Person have a non-trivial constructor?
 
Xeo
auto* person = new (&storage[0]) Person(...);
 
you need to consider alignment though
 
Xeo
11:02 AM
Only seen LPs
looks too unfinished for my taste
 
Well, it's a pre-alpha...
 
Xeo
@StackedCrooked As I said above: use std::aligned_storage_t
 
@fredoverflow Why does the constructor of Person matter? I happened to use 'strncpy' in mine, which may make it non-trivial. But you may have implemented yours differently.
 
Xeo
@fredoverflow yeah, so I won't buy it (yet) :P
 
@Xeo Ah. Good :)
 
11:04 AM
@Brandin Well, if the constructor is non-trivial, then you must use placement-new. Otherwise, you can simply cast a pointer and be done with it.
@Xeo But are you as excited as I am? :)
 
Xeo
looks a bit... boring? atm
like, yay you can collect resources
but other than that...
 
But YouTubers seem to have so much fun with it :D
You can also get killed by sandstorms and farting plants!
 
@Xeo new (&storage[0]) works, but as soon as you need indexing, I think it becomes uglier than the reinterpret_cast proposal, and easier to get wrong.
 
@Xeo You know what, I'm gonna buy the game right now to support the development.
 
Xeo
@Brandin err, no? The reinterpret_cast is just wrong.
There might be no Person at that point.
 
11:13 AM
I don't see how it's wrong. I get the same result for both versions.
 
Xeo
yes, because every problematic behaviour in C++ manifests immediately, right?
 
Ell
@fredoverflow dangerous
 
I think it is right either way. It's just a difference in syntax.
Trying to put everything into the new placement parameters leads to unwieldy syntax such as new (&storage[0] + n * sizeof(Person)). Perhaps you get it right each time, but I tend to make mistakes, so I will avoid that type of expression.
 
Ell
@Brandin it's not right either way
if you haven't constructed a Person in some memory, there is not a Person there
 
I declared std::vector<const String&, size> TagsStorage
 
11:22 AM
@Ell What do you mean? The Person constructor constructs the Person. new (...) Person(...);
 
Ell
@Brandin but, you were just doing reinterpret_cast on some memory, right?
 
Of course.
 
Ell
so you're not calling the constructor
if you just reinterpret_cast
 
The context is
``
void *address = reinterpret_cast<Person*>(storage) + 1;
Person* pp = new (address) Person("some_first_name", "some_last_name");
``
The constructor is called in the new expression, not in reinterpet_cast.
 
Ell
@Brandin what is storage?
(also fyi, code snippets need to be indented by four spaces in their own message)
 
11:28 AM
59 mins ago, by Brandin
I don't see the problem with the syntax. For example this works fine:

char storage[10000];

int main()
{
void *address = reinterpret_cast<Person*>(&storage) + 1;
Person* pp = new (address) Person("some_first_name", "some_last_name");
cout << "pp:" << *pp << "\n";
}
49 mins ago, by Telkitty
reinterpret_cast a char array into a person is like making a cat from meat mince, maybe worse
 
@Telkitty Wrong quote. I amended the cast to reinterpret_cast<Person*>(storage) + 1;
 
raw memory management is C style, yet person, which is an object is C++ style
@Brandin then use std::vector<Person> person
 
@Telkitty No, reinterpret_cast is a C++ style cast. An example of a C-style cast is ``(Person*)storage + 1``. I'm not sure off the top of my head whether that one would be legal or not.
The situation may be, you need to save an object to a spot in memory. Maybe that spot is memory-mapped to a hardware device. This is supported in C++. Constructing a vector of Person's is the normal case, but would not let you choose where to put it in memory.
 
Xeo
Yes, the cast is C++, but the principle, the way of thinking of doing things like that is very C-ish.
 
@Xeo I can't argue that point. But I still haven't seen someone show a C++-ish way.
 
11:35 AM
@Brandin you would not know where it's stored in the physical memory anyways, people access elements in the vector using iterators or member functions
of course you can implement your own function similar toString and fromString to access the elements in the char array
 
@Telkitty Exactly, that is the normal case. Placement new is for when you need to know where it is in memory. If you write new (x) ... O(...), then you know your O instance is at x.
 
Hey guys
Can somebody help me with variants?
HALP
@Brandin HOW BOUT YOU?!
 
@VermillionAzure Ask your question and if someone wants to help they will
 
Well duh.
 
But nobody responded so I was wondering
 
11:48 AM
Anywyas
How do I make a makeshift variant? I know about Boost.Variant and C++17 variant but I can't use both right now
 
@VermillionAzure Then use union. That is probably the primitive on which those classes are based.
 
@Brandin Right... But I still want to be able to return the concrete type as needed
 
@VermillionAzure you can ... use namespace to identify which you are you using
 
@Telkitty ...
 
This is one of the best answers I've ever seen on SO. — Tyler 2 hours ago
 
11:50 AM
No, I mean I want ot make a makeshift one
 
D'aw
 
Howdy.
 
Ven
Hi
 
How are you? :3
 
00:00 - 12:0012:00 - 00:00

« first day (2282 days earlier)      last day (2666 days later) »