It seems [=] functionality C++ does not exist in D.
By using a helper function I made that example work.
```d
import std.stdio;
auto localFoo(int x) {
return (){ return x;};
}
void main() {
int x = 10;
auto lambda = (int capturedX = x) {
writeln("Captured reference : ", ca
D has the pragma(lib) feature where you can tell the compiler
to link with a specific library as well. For example:
pragma(lib, "curl");
I want to try that as soon as I get home from work.
You probably need to make a .lib file from the dll too. The
implib program does that.
If you don't
Thanks a lot, your answers are very useful for me .
Nothing wrong with toUtf32, I just didn't know it.
I want to use my char array with awesome, cool std.algorithm
functions. Since many of this algorithms requires like slicing
etc.. I prefer to create my string with Utf32 chars. But by
default all strings literals are Utf8 for performance.
With my current knowledge I use to!dhar to convert Utf8
I have been ask to write a test tool which initiates
DNS-HTTP-HTTPS-TCP sessions. And ofcourse I wrote this with D.
For HTTP I used std.net like "m_HTTP =
HTTP(m_url);m_HTTP.perform();"
For DNS I simply used "getAddressInfo(m_domainName);"
Than tool makes some simple checks which are npt su
@Tobias @Ali @Jonathan @Steven
Thanks alot for your answers.
I will try to learn as much as I can from them.
Regards
Erdem
I have an char[];
char[] strArr = "http://www.hurriyet.com.tr/ekonomi".dup;
I stripped the domain out of url like:
auto domain = findSplitAfter(strArr, "http://";)[1].until('/');
Than because I am new to the language I became curious if I
change domain(which I believe a input iterator); the v
get("https://dlang.org";, http);
It works as I wanted, thanks a lot .
Regards
Erdem
Hi
We have a network traffic logger module at office.
We need to a tool which creates simple traffic with different
protocols and test our product's output to see if we parse the
headers correctly or not.
And of course I proposed writing this tool with D!!!
When it comes to create a HTTP ses
auto sum = aArr.map!`a.count`.reduce!((a,b) => a + b);
Rikki Thanks a lot. It works.
Function map!"a.count"(aArr) surprises me a little.
Because when I read std.algorithm reference: `Implements the
homonym function (also known as transform)`.
Which reminds me C++ transform and it will never
I can use filter algorithm with my types easily.
struct A
{
string value;
int count;
}
void main( string[] args )
{
A[] aArr;
aArr ~= A("HTTP", 3);
aArr ~= A("HTTPS", 2);
aArr ~= A("UNKNOWN_TCP", 4);
aArr.filter!( a => a.count == 2);
Thanks a lot,
I will follow your advise and implement this part same as your
example.
Regards
Kadir Erdem
don't beleive what you see! ;-)
I am sorry make a busy community more busy with false alarms.
When I write to file I saw Record Separator really exists.
I hope my second question is a valid one.
How can I write the code below better? How can I reduce the
number of foreach? statements.
Fi
I am opening a .gz file and reading it chunk by chunk for
uncompressing it.
The data in the uncompressed file is like : aRSbRScRSd, There are
record separators(ASCII code 30) between each record(records in
my dummy example a,b,c).
File file = File(mylog.gz, "r");
auto uc = new UnComp
14 matches
Mail list logo