User we need you to code the customer struct

>user we need you to code the customer struct
struct Customer {
short id;
int age;
std::optional Services;
long long gender;
};

Attached: sweating meme.jpg (300x300, 14K)

>long long gender
Are there negative genders?

WE JUST DON'T KNOW

>using code as a verb
Turn 360 degrees and apply somewhere else

You're right, he should have used std::complex.

>optional vector
Why not just vector and check if there's anything in the vector?

I think you mean 180 degrees lol

Attached: images(7).jpg (300x168, 5K)

char[255] gender;

>boss found the customer struct

c-let here, can the struct size scale or how is the vector going to work ?

Newfren

user, I identify as a Homodemiandrobiqueernonbinarygenderfluidhomodemiandrobiqueernonbinarygenderfluidsaclefurtransagehelicopterkinquestioningheterodemiandrobiqueernonbinarygenderfluidhomodemiandrobiqueernonbinarygenderfluidsaclefurtransagehelicopterkinquestioningsaclefurtranskin and frankly I am disgusted by your technical oppression

struct Customer {
short id;
int age;
std::optional Services;
long long gender;
bool* is_retarded;
};


Fix'd

>customer struct
In any codebase of more than a hundred thousand lines, the customer tends to be more of a conceptual idea than an individual struct. I think we might even have dozens of different types used to represent clients in various contexts...

>bool *

But why.

Attached: 1534279422800-g.jpg (400x400, 16K)

no matter what he uses it'll be binary

Attached: kek.jpg (225x224, 5K)

Completely retarded use of std::optional. This would look terrible on a code review.
No type on std::vector. Won't compile.
What the fuck is that retarded bool pointer?

Bait successful

>bool*
based

The storage for vector data is allocated on heap, so the data is outside the struct, only a pointer to it is in the struct.

>not wanting to kode with klossy

Holy fuck this thread is fucking shit

double gender;

>Are there negative genders?
Hey baby, what's your sign?

struct Me_Irl {
short sighted;
int eresting;
long long dick;
double standards;
bool ly_pls;
};

xddd

>int age

Fucking mysoginist pig!
Eigen::Matrix gender;
Fixed.

Yes, female.

Did you just assume my dimensionality?

le ebin meme my fren! :DDD

Attached: ebin!.png (512x512, 51K)

>bool*
Now that is based and redpilled

You want to share the truth

Serious question, are you the same fucking faggot that goes into every thread posting this? Because it's not funny, it's fucking gay

Attached: 1515873661934.jpg (1024x1024, 71K)

Are you the same fucking faggot that posts frogs everywhere?

Attached: 1417961594353s.jpg (231x218, 7K)

turbo kek

Cringe and bluepilled

>I was only pretend to be retard

>int age
You have a bigger problem, OP.

Yes, they are the same fucking faggot that posts frogs everywhere.

Go back to fucking reddit then if you don't like it. You fags ruined Jow Forums anyway

Attached: 1524868103481.jpg (227x222, 6K)

Dumb frogposter

You can determine is_retarded by the gender.

>bool*
unique_ptr ffs

double TotalSpent;

/thread

Retard

struct Customer {
auto id;
char age;
std::optional Services;
std::string gender;
};

That's exactly what he's doing. is_retarded will point to gender.

>long long gender;
>not using a data center's worth of data to enumerate it
SHITLORD!!!!!!!!!111

struct Customer {
short id;
int age;
std::optional Services;
std::unique_ptr gender;

Customer()
: gender(malloc(1024 * 1024 * 1024 * 4)) {} // 4GB integer.
};


gender of 0 must be male then.
Also you're reinterpreting a type as another type where neither are char. That's undefined behaviour.

>that data alignment

frog website

What about it?

Holy shit, this fucking thread. Shit and gold at the same time

Attached: jpg.jpg (3264x2448, 2.13M)

Girl *trap = (Girl*) malloc(sizeof(Boy));

>long long gender
should have used a matrix

>H-how’s this boss?

Attached: Skeleton.png (463x888, 30K)

Why isn't gender optional as well you fucking shitlord?
Why isn't it a vector?
I am SO FUCKING SICK of the bigotry on this stupid site.

Attached: 1531130777708.jpg (619x453, 47K)

with floats because "spectrum"

Under rated post. Top kek

Did you just assume my gender is on a binary spectrum?

struct Customer {
std::uint32_t id_;
std::uint8_t age_;
std::optional services_;
bool gender_;
bool is_faggot_;
};

Attached: 1534244540734.jpg (680x788, 74K)

>_
stop this faggotry immediately.

>_
>classes with PascalCase
kill your self and don't ever touch c++ again.

PascalCase class is the standard you kill your self

>casting the return of malloc
1990 called

struct Customer {
std::optional services;
std::uint32_t id;
std::uint8_t age;
bool gender;
bool is_faggot;
bool padding;
};

Attached: a4572a823581162d9ba42d15a2bf3fcbe267022ea741aa57b0ab87833366630b.png (714x810, 87K)

DATA DIVISION.
WORKING-STORAGE SECTION
01 CUSTOMER-RECORD.
02 CUSTOMER-ID PIC 9(09).
02 CUSTOMER-AGE PIC 9(02).
02 CUSTOMER-TABLE-SERVICE OCCURS 100 TIMES.
05 CUSTOMER-SERVICE PIC X(80).
02 CUSTOMER-SEX PIC X.
88 IS-MALE VALUE 'M'.
88 IS-FEMALE VALUE 'F'.

unsigned long long int id;
unsigned long long int age;
double masculinity;
double feminity;
double chroma[3];

Attached: Slice_1.png (3135x3520, 849K)

Wow, actually correct data alignment
Why is the vector optional though, it can be empty

I guess there's no need for the "_" since struct is public by default...

I fail to see how that helps, we have presumably a pointer, std::optional, for 64 bits, 8 bits age, a 32 bit id, and I'd assume bool is 32 bits too, for 128 + 32 + 8 bits. How does adding 32 bits padding help?

What language is this?

>auto id in a struct declaration
Does that actually work? I thought you could only use auto if you immediately assigned the declared variable.

No, and he's a fucking retard who doesn't know C++.

Because the original would look like this in memory:
>struct Customer {
> std::uint32_t id_;
> std::uint8_t age_;
std::uint8_t pad[3];
> std::optional services_;
> bool gender_;
> bool is_faggot_;
>};
Totalling 18 bytes
A bool is 1 byte btw.
The proper ordered version is only 16 bytes.

>tfw bool is 8 bits and not 32
I feel lied to.

Maybe. I was to lazy to check std::optional size so I assumed it's about 4 bytes...

>I feel lied to.
Wew. Just read a book or think for once

It doesn't change anything, since because of the vector it is at least pointer aligned. We are at +5 byte offset, so both on 32 and 64 bit it would use 3 bytes padding at least.

I've read that the compiler might insert padding automatically; it'll probably rearrange all compound data types on forced optimization...

It does not rearrange (well, not gcc, clang and msvc at least), only inserts padding.

I could never tell if this was a metameme.

bool man;

Girl trap = reinterpret_cast(Boy());

template
struct GenderSpectrum{
T h,s,v;
};

struct Customer{
GenderSpectrum gender;
std::vector services;
std::uint32_t id;
std::uint8_t age;
}

Attached: 1533854630851.jpg (710x473, 126K)

how long did it take you to write that

No, dude, ever heard of the moonwalk?

It's not allowed to rearrange.
If you have the struct
struct S {
A a;
B b;
C c;
};

then &a < &b < &c is guaranteed by the standard.

I've only heard that &s.a == &s is guaranteed by the standard. Can you show where in the standard it guarantees the ordering of the pointers matches the order of declarations?

based and kekpilled

How dare you assume my gender is within a defined spectrum.

> &a < &b < &c
Comparing pointers (with , =) to different objects is UB, you moron.

"Funny". IRL if it's an issue the standard way is to have 3 or 4 variants:
Male
Female
Other
Unspecified (optional)

>dumb frogposter thinks someone else ruined Jow Forums

Attached: 1526908101238.jpg (590x421, 20K)

huh, it seems you're correct. What is the advantage of this?
In any case, just cast it to uintptr_t first

>age as std::uint8_t

0-255 What's wrong with that?