On Tuesday, 2 August 2016 at 07:24:28 UTC, Saurabh Das wrote:
How can I substitute the type of an argument received via a
varadic template?
For example say I want to generalise this scenario:
auto myConverterFunction1(bool arg1, bool arg2, ubyte arg3, int
arg4)
{
return
On Sunday, 31 July 2016 at 23:36:54 UTC, Cassio Butrico wrote:
in C:\d\dmd2\samples\d winsamp.d dont compiler.
dmd winsamp gdi32.lib winsamp.def
winsamp.d(53): Error: function
core.sys.windows.winuser.LoadIconA (void*, const(char)*) is not
callable using argument types (typeof(null), wchar*)
On Monday, 15 February 2016 at 11:38:05 UTC, Suliman wrote:
I have got class Config with method parseconfig. I need
terminate App if parsing of config was failed. The problem that
I do not know how to do it better.
void parseconfig()
{
try
{
//something go wrong
}
catch(Exception e)
{
On Sunday, 17 January 2016 at 10:34:19 UTC, locco wrote:
Hi :)
I found this example:
==
import std.file: write;
import std.string: representation;
void main()
{
char[] data = "Test data.\n".dup;
// Create an ArchiveMember
Take the following code for example
module test;
import std.stdio;
void test(T...)(lazy T args)
{
foreach(arg;args) //bar is invoked here
{
writeln("about to process arg");
writefln("processing arg %s",arg); //but it should be invoked
here, right?
}
}
On Sunday, 21 June 2015 at 13:12:03 UTC, MGW wrote:
Linux 32, dmd 2.067.0
I want to connect and execute function D from main() C++.
d1.d
import core.stdc.stdio;
extern (C++) void d1() {
printf(printf - exec d1());
}
main_c1.cpp
#include stdio.h
void d1(void);
int
is there any way to detect if a file is a binary executable that
is cross platform or a way to detect whether pipeprocss failed to
execute a file if it wasn't executable.
I'm trying to add gzip compression to a HTTP server i wrote in D.
here is the code that dose the gzip encoding.
if ((Info.modGzip)
(indexOf(client.getRequestHeaderFieldValue(Accept-Encoding),gzip)
!= -1)){
writeln(gzip);
auto gzip = new Compress(HeaderFormat.gzip);
On Sunday, 20 July 2014 at 09:53:52 UTC, Jonathan M Davis wrote:
On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:
How do i get an os thread handle from a thread object.
or are d thread not wrapped os threads.
They do wrap OS threads, but they encapsulate them in a
cross-platform
is there any way for an object to make it self no longer usable?
eg
class someclass {
string somevalue;
bool someflag;
int somelength;
this (value,length,flag) {
somevalue = value;
someflag = flag;
somelength =
On Saturday, 19 July 2014 at 13:46:08 UTC, Kagamin wrote:
You can encapsulate it in a wrapper, which will control access
to the object and reject if necessary.
how ?
surely not by writing another class with wrapper methods for the
existing one.
i have the following code
char[] Etag(string file){
auto info = DirEntry(file);
ubyte[16] hash = md5Of(to!string(info.timeLastAccessed.day)~
to!string(info.timeLastAccessed.month)~
How Can I Iterate through JSON Subkeys using std.json? Or Do I
Have To Use An External Library For that
How Can I Print Raw Binary Into The Console?
I Have Variable Of Type ubyte which equals 0b011 How Can I Get
The Variable To Print Out As 011
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32 bit
int
and convert the 32 bit int back into a 4 bytes again.
On Thursday, 10 July 2014 at 13:51:22 UTC, Rikki Cattermole wrote:
On 11/07/2014 1:18 a.m., Sean Campbell wrote:
perhaps I'd better state what I'm doing.
i have an array of 4 bytes and a want to convert them to a 32
bit
int
and convert the 32 bit int back into a 4 bytes again.
Small hack I
On Thursday, 10 July 2014 at 15:51:11 UTC, Olivier Pisano wrote:
Hello,
I may have not understood what you actually want to do, but
aren't std.bitmanip.peek or std.bitmanip.read what you are
looking for ?
http://dlang.org/phobos/std_bitmanip.html#.peek
std.bitmanip.peek and std.bitmanip.read
I cannot figure out what is wrong with this code and why i keep
getting object.error access violation. the code is simple
tutorial code for SDL and OpenGL what am i doing wrong (the
access violation seems to be with glGenBuffers)
The Code
import std.stdio;
import derelict.opengl3.gl3;
import
On Friday, 4 July 2014 at 08:02:59 UTC, Misu wrote:
Can you try to add DerelictGL3.reload(); after
SDL_GL_CreateContext ?
yes this solved the problem. however why? is it a problem with
the SDL binding?
i know you can use both
throw new Exception(msg);
and
module test;
class testException {
this (string msg) {
super(some error info : ~msg);
}
}
throw new testException(msg);
but which one is better conforms to the d style?
On Wednesday, 25 June 2014 at 09:54:16 UTC, bearophile wrote:
Sean Campbell:
but which one is better conforms to the d style?
Both are valid. Use the second when you want a more precise
exception in your code, this is common in larger programs.
Keep in mind that you can allocate an
21 matches
Mail list logo