Click here to Skip to main content
14,242,790 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: Hello from Saint Moritz Pin
Mike Hankey27-Apr-19 8:58
professionalMike Hankey27-Apr-19 8:58 
GeneralRe: Trying to like Rust Pin
MSBassSinger29-Apr-19 5:30
professionalMSBassSinger29-Apr-19 5:30 
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 7:47
memberDean Roddey29-Apr-19 7:47 
GeneralRe: Trying to like Rust Pin
markrlondon29-Apr-19 7:21
membermarkrlondon29-Apr-19 7:21 
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 7:57
memberDean Roddey29-Apr-19 7:57 
GeneralRe: Trying to like Rust Pin
markrlondon29-Apr-19 8:37
membermarkrlondon29-Apr-19 8:37 
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 8:48
memberDean Roddey29-Apr-19 8:48 
GeneralRe: Trying to like Rust Pin
Member 413801729-Apr-19 7:35
memberMember 413801729-Apr-19 7:35 
> One I ran into tonight is that there's no such thing as a constructor
The problem you're describing is not the absence of a constructor but the absence of function overloading. Rust doesn't have constructors, because there's no need for a constructor as a separate function. That said, rust differentiates between function identifiers and struct identifiers, so you can create a function with the same name as the struct and call it. It will look just like a constructor in C++.

The reason rust doesn't have overloading is explained here.
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 7:50
memberDean Roddey29-Apr-19 7:50 
GeneralRe: Trying to like Rust Pin
Member 413801729-Apr-19 8:15
memberMember 413801729-Apr-19 8:15 
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 8:28
memberDean Roddey29-Apr-19 8:28 
GeneralRe: Trying to like Rust Pin
Dean Roddey29-Apr-19 8:53
memberDean Roddey29-Apr-19 8:53 
GeneralRe: Trying to like Rust Pin
Gerry Schmitz29-Apr-19 17:25
mveGerry Schmitz29-Apr-19 17:25 
GeneralThoughts about the universe, life, and everything.... Pin
stoneyowl226-Apr-19 16:20
memberstoneyowl226-Apr-19 16:20 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Dean Roddey26-Apr-19 16:54
memberDean Roddey26-Apr-19 16:54 
AnswerRe: Thoughts about the universe, life, and everything.... Pin
abmv26-Apr-19 18:46
professionalabmv26-Apr-19 18:46 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
OriginalGriff26-Apr-19 21:32
protectorOriginalGriff26-Apr-19 21:32 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
PIEBALDconsult26-Apr-19 19:25
protectorPIEBALDconsult26-Apr-19 19:25 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Mark_Wallace26-Apr-19 22:35
memberMark_Wallace26-Apr-19 22:35 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Jörgen Andersson27-Apr-19 0:20
protectorJörgen Andersson27-Apr-19 0:20 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Mark_Wallace27-Apr-19 5:14
memberMark_Wallace27-Apr-19 5:14 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
dandy7227-Apr-19 4:12
memberdandy7227-Apr-19 4:12 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Mark_Wallace27-Apr-19 5:17
memberMark_Wallace27-Apr-19 5:17 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Dean Roddey27-Apr-19 6:13
memberDean Roddey27-Apr-19 6:13 
GeneralRe: Thoughts about the universe, life, and everything.... Pin
Mark_Wallace3-May-19 19:27
memberMark_Wallace3-May-19 19:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.