www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Basic example of "std.process.pipe" not working. Error: template

reply BoQsc <vaidas.boqsc gmail.com> writes:
https://dlang.org/library/std/process/pipe.html

```
import std;

void main()
{
	auto p = pipe();
	
}
```
Output:

```
/dlang/dmd/linux/bin64/../../src/phobos/std/functional.d(1272): 
Error: template instance `std.functional.compose!()` does not 
match template declaration `compose(fun...)`
   with `fun = ()`
   must satisfy the following constraint:
`       fun.length > 0`
onlineapp.d(5): Error: template instance `std.functional.pipe!()` 
error instantiating
```
Oct 16 2023
next sibling parent BoQsc <vaidas.boqsc gmail.com> writes:

https://run.dlang.io/is/uAI7qM
Oct 16 2023
prev sibling next sibling parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Monday, 16 October 2023 at 17:23:10 UTC, BoQsc wrote:
 import std;
When you do this, you get ALL things that match a name from the whole stdlib. pipe is used in a couple places.
 	auto p = pipe();
make this p = std.process.pipe(); to clarify which version you want and it might work , or change the import std; over to import std.process.
Oct 16 2023
parent bachmeier <no spam.net> writes:
On Monday, 16 October 2023 at 17:33:23 UTC, Adam D Ruppe wrote:
 On Monday, 16 October 2023 at 17:23:10 UTC, BoQsc wrote:
 import std;
When you do this, you get ALL things that match a name from the whole stdlib. pipe is used in a couple places.
It would be nice if the error message included this information (at a generic level, not specific to this case). If there's no matching function and you've done import.std, it should tell the user to check for that type of conflict.
Oct 16 2023
prev sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Monday, 16 October 2023 at 17:23:10 UTC, BoQsc wrote:
 https://dlang.org/library/std/process/pipe.html

 ```
 import std;

 void main()
 {
 	auto p = pipe();
 	
 }
 ```
 Output:

 ```
 /dlang/dmd/linux/bin64/../../src/phobos/std/functional.d(1272): 
 Error: template instance `std.functional.compose!()` does not 
 match template declaration `compose(fun...)`
   with `fun = ()`
   must satisfy the following constraint:
 `       fun.length > 0`
 onlineapp.d(5): Error: template instance 
 `std.functional.pipe!()` error instantiating
 ```
```d import std.process; void main() { auto p = pipe(); // do stuff } ```
Oct 16 2023